blob: bcd23ab9033d802b52d85e01e40b324009fb828e [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"):
Anand Doshi3decf4d2014-02-06 12:50:14 +05309 from webnotes.templates.pages.contact import send_message as website_send_message
Anand Doshifb109ad2013-09-11 18:58:20 +053010
11 if not website_send_message(subject, message, sender):
12 return
Anand Doshidf019802013-12-04 16:27:30 +053013
14 if subject=="Support":
15 # create support ticket
Rushabh Mehta1f847992013-12-12 19:12:19 +053016 from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication
Anand Doshidf019802013-12-04 16:27:30 +053017 add_support_communication(subject, message, sender, mail=None)
18 else:
19 # make lead / communication
Rushabh Mehta1f847992013-12-12 19:12:19 +053020 from erpnext.selling.doctype.lead.get_leads import add_sales_communication
Anand Doshidf019802013-12-04 16:27:30 +053021 add_sales_communication(subject or "Website Query", message, sender, sender,
22 mail=None, status=status)
Anand Doshi619ed5e2013-09-17 13:46:50 +053023