Rushabh Mehta | ad45e31 | 2013-11-20 12:59:58 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
Anand Doshi | 330dae9 | 2013-09-10 13:46:15 +0530 | [diff] [blame] | 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import webnotes |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 6 | |
| 7 | @webnotes.whitelist(allow_guest=True) |
| 8 | def send_message(subject="Website Query", message="", sender="", status="Open"): |
Rushabh Mehta | 39bb8e2 | 2013-12-11 15:32:14 +0530 | [diff] [blame] | 9 | from webnotes.website.doctype.contact_us_settings.templates.pages.contact \ |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 10 | import send_message as website_send_message |
| 11 | |
| 12 | if not website_send_message(subject, message, sender): |
| 13 | return |
Anand Doshi | df01980 | 2013-12-04 16:27:30 +0530 | [diff] [blame] | 14 | |
| 15 | if subject=="Support": |
| 16 | # create support ticket |
Rushabh Mehta | 1f84799 | 2013-12-12 19:12:19 +0530 | [diff] [blame] | 17 | from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication |
Anand Doshi | df01980 | 2013-12-04 16:27:30 +0530 | [diff] [blame] | 18 | add_support_communication(subject, message, sender, mail=None) |
| 19 | else: |
| 20 | # make lead / communication |
Rushabh Mehta | 1f84799 | 2013-12-12 19:12:19 +0530 | [diff] [blame] | 21 | from erpnext.selling.doctype.lead.get_leads import add_sales_communication |
Anand Doshi | df01980 | 2013-12-04 16:27:30 +0530 | [diff] [blame] | 22 | add_sales_communication(subject or "Website Query", message, sender, sender, |
| 23 | mail=None, status=status) |
Anand Doshi | 619ed5e | 2013-09-17 13:46:50 +0530 | [diff] [blame] | 24 | |