blob: d75499ff535fb5d7d3649aa6ef4043f21cb4a7c0 [file] [log] [blame]
Rushabh Mehtaad45e312013-11-20 12:59:58 +05301# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
Anand Doshi330dae92013-09-10 13:46:15 +05302# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5import webnotes
Anand Doshifb109ad2013-09-11 18:58:20 +05306
7@webnotes.whitelist(allow_guest=True)
8def send_message(subject="Website Query", message="", sender="", status="Open"):
Rushabh Mehta39bb8e22013-12-11 15:32:14 +05309 from webnotes.website.doctype.contact_us_settings.templates.pages.contact \
Anand Doshifb109ad2013-09-11 18:58:20 +053010 import send_message as website_send_message
11
12 if not website_send_message(subject, message, sender):
13 return
Anand Doshidf019802013-12-04 16:27:30 +053014
15 if subject=="Support":
16 # create support ticket
Rushabh Mehta1f847992013-12-12 19:12:19 +053017 from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication
Anand Doshidf019802013-12-04 16:27:30 +053018 add_support_communication(subject, message, sender, mail=None)
19 else:
20 # make lead / communication
Rushabh Mehta1f847992013-12-12 19:12:19 +053021 from erpnext.selling.doctype.lead.get_leads import add_sales_communication
Anand Doshidf019802013-12-04 16:27:30 +053022 add_sales_communication(subject or "Website Query", message, sender, sender,
23 mail=None, status=status)
Anand Doshi619ed5e2013-09-17 13:46:50 +053024