[communications] [minor] Code cleanup so it can be extended by custom script

This commit is contained in:
Rushabh Mehta
2013-08-29 13:53:36 +05:30
parent 8ba2f6396b
commit 46ec268e9b
4 changed files with 14 additions and 19 deletions

View File

@@ -20,7 +20,7 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
# make lead / communication
from selling.doctype.lead.get_leads import add_sales_communication
add_sales_communication(subject or "Website Query", message, sender, sender,
message = add_sales_communication(subject or "Website Query", message, sender, sender,
mail=None, status=status)
# guest method, cap max writes per hour
@@ -29,4 +29,4 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
webnotes.response["message"] = "Sorry: we believe we have received an unreasonably high number of requests of this kind. Please try later"
return
webnotes.response["message"] = 'Thank You'
webnotes.response.status = "okay"

View File

@@ -26,7 +26,12 @@ $(document).ready(function() {
sender: email,
message: message,
callback: function(r) {
msgprint(r.message);
if(r.status==="okay") {
msgprint(r.message or "Sent")
} else {
msgprint("There were errors");
console.log(r.exc);
}
$(':input').val('');
}
});