blob: 6f4f4ee3adc4fdd293cae5f5b69e35f54b210f31 [file] [log] [blame]
Anand Doshi885e0742015-03-03 14:55:30 +05301# Copyright (c) 2015, Frappe 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 Mehta3daa49a2014-10-21 16:16:30 +05305
6import frappe, json
7from frappe import _
8from frappe.utils import cint, formatdate
Anand Doshifb109ad2013-09-11 18:58:20 +05309
Rushabh Mehta793ba6b2014-02-14 15:47:51 +053010@frappe.whitelist(allow_guest=True)
Anand Doshifb109ad2013-09-11 18:58:20 +053011def send_message(subject="Website Query", message="", sender="", status="Open"):
Rushabh Mehta793ba6b2014-02-14 15:47:51 +053012 from frappe.templates.pages.contact import send_message as website_send_message
Anand Doshi5d591eb2014-04-18 16:15:31 +053013
Rushabh Mehta5cdc8e52014-09-15 16:59:38 +053014 website_send_message(subject, message, sender)
Anand Doshi5d591eb2014-04-18 16:15:31 +053015
Rushabh Mehta5cdc8e52014-09-15 16:59:38 +053016 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 Mehtaddd79f42015-08-25 14:03:43 +053024
25 return "okay"