2013-11-20 12:59:58 +05:30
|
|
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
2013-09-10 13:46:15 +05:30
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
2014-02-14 15:47:51 +05:30
|
|
|
import frappe
|
2013-09-11 18:58:20 +05:30
|
|
|
|
2014-02-14 15:47:51 +05:30
|
|
|
@frappe.whitelist(allow_guest=True)
|
2013-09-11 18:58:20 +05:30
|
|
|
def send_message(subject="Website Query", message="", sender="", status="Open"):
|
2014-02-14 15:47:51 +05:30
|
|
|
from frappe.templates.pages.contact import send_message as website_send_message
|
2014-05-02 18:16:45 +05:30
|
|
|
res = website_send_message(subject, message, sender)
|
2014-04-18 16:15:31 +05:30
|
|
|
|
2014-05-02 18:16:45 +05:30
|
|
|
if not res:
|
2013-09-11 18:58:20 +05:30
|
|
|
return
|
2014-04-18 16:15:31 +05:30
|
|
|
|
2013-12-04 16:27:30 +05:30
|
|
|
if subject=="Support":
|
|
|
|
# create support ticket
|
2013-12-12 19:12:19 +05:30
|
|
|
from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication
|
2013-12-04 16:27:30 +05:30
|
|
|
add_support_communication(subject, message, sender, mail=None)
|
|
|
|
else:
|
|
|
|
# make lead / communication
|
2013-12-12 19:12:19 +05:30
|
|
|
from erpnext.selling.doctype.lead.get_leads import add_sales_communication
|
2014-04-18 16:15:31 +05:30
|
|
|
add_sales_communication(subject or "Website Query", message, sender, sender,
|
2013-12-04 16:27:30 +05:30
|
|
|
mail=None, status=status)
|
2014-04-18 16:15:31 +05:30
|
|
|
|
2014-05-02 18:16:45 +05:30
|
|
|
return res
|