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
|
|
|
|
import webnotes
|
2013-09-11 18:58:20 +05:30
|
|
|
|
|
|
|
@webnotes.whitelist(allow_guest=True)
|
|
|
|
def send_message(subject="Website Query", message="", sender="", status="Open"):
|
2013-12-11 15:32:14 +05:30
|
|
|
from webnotes.website.doctype.contact_us_settings.templates.pages.contact \
|
2013-09-11 18:58:20 +05:30
|
|
|
import send_message as website_send_message
|
|
|
|
|
|
|
|
if not website_send_message(subject, message, sender):
|
|
|
|
return
|
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
|
2013-12-04 16:27:30 +05:30
|
|
|
add_sales_communication(subject or "Website Query", message, sender, sender,
|
|
|
|
mail=None, status=status)
|
2013-09-17 13:46:50 +05:30
|
|
|
|