diff --git a/public/js/website_utils.js b/public/js/website_utils.js index f35ad4cc784..ff480ed5ee2 100644 --- a/public/js/website_utils.js +++ b/public/js/website_utils.js @@ -14,6 +14,7 @@ erpnext.send_message = function(opts) { cmd: "website.send_message", subject: opts.subject, sender: opts.sender, + status: opts.status, message: typeof opts.message == "string" ? opts.message : JSON.stringify(opts.message) diff --git a/website/__init__.py b/website/__init__.py index 32d7116b9cd..909a9367689 100644 --- a/website/__init__.py +++ b/website/__init__.py @@ -11,13 +11,13 @@ max_tickets_per_hour = 200 @webnotes.whitelist(allow_guest=True) def send_message(): from webnotes.model.doc import Document - args = webnotes.form_dict d = Document('Support Ticket') d.subject = webnotes.form_dict.get('subject', 'Website Query') d.description = webnotes.form_dict.get('message') d.raised_by = webnotes.form_dict.get('sender') - + d.status = webnotes.form_dict.get("status") or "Open" + if not d.description: webnotes.response["message"] = 'Please write something' return