blob: e98a5c046b535d0a3f2839d22f9034ac343528e4 [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
Rushabh Mehta793ba6b2014-02-14 15:47:51 +05305import frappe
Anand Doshifb109ad2013-09-11 18:58:20 +05306
Rushabh Mehta793ba6b2014-02-14 15:47:51 +05307@frappe.whitelist(allow_guest=True)
Anand Doshifb109ad2013-09-11 18:58:20 +05308def send_message(subject="Website Query", message="", sender="", status="Open"):
Rushabh Mehta793ba6b2014-02-14 15:47:51 +05309 from frappe.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