Anand Doshi | 885e074 | 2015-03-03 14:55:30 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe 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 |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 5 | |
| 6 | import frappe, json |
| 7 | from frappe import _ |
| 8 | from frappe.utils import cint, formatdate |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 9 | |
Rushabh Mehta | 793ba6b | 2014-02-14 15:47:51 +0530 | [diff] [blame] | 10 | @frappe.whitelist(allow_guest=True) |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 11 | def send_message(subject="Website Query", message="", sender="", status="Open"): |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 12 | from frappe.www.contact import send_message as website_send_message |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 13 | |
Rushabh Mehta | 5cdc8e5 | 2014-09-15 16:59:38 +0530 | [diff] [blame] | 14 | website_send_message(subject, message, sender) |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 15 | |
Rushabh Mehta | 5cdc8e5 | 2014-09-15 16:59:38 +0530 | [diff] [blame] | 16 | comm = frappe.get_doc({ |
| 17 | "doctype":"Communication", |
| 18 | "subject": subject, |
| 19 | "content": message, |
| 20 | "sender": sender, |
| 21 | "sent_or_received": "Received" |
| 22 | }) |
| 23 | comm.insert(ignore_permissions=True) |
Rushabh Mehta | ddd79f4 | 2015-08-25 14:03:43 +0530 | [diff] [blame] | 24 | |
| 25 | return "okay" |