diff --git a/erpnext/hooks.py b/erpnext/hooks.py index c4032596f47a..f1ee370e97ee 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -30,10 +30,6 @@ override_doctype_class = {"Address": "erpnext.accounts.custom.address.ERPNextAddress"} -override_whitelisted_methods = { - "frappe.www.contact.send_message": "erpnext.templates.utils.send_message" -} - welcome_email = "erpnext.setup.utils.welcome_email" # setup wizard diff --git a/erpnext/public/js/website_utils.js b/erpnext/public/js/website_utils.js index 2bb5255eebc7..b5416065d791 100644 --- a/erpnext/public/js/website_utils.js +++ b/erpnext/public/js/website_utils.js @@ -3,6 +3,18 @@ if(!window.erpnext) window.erpnext = {}; +// Add / update a new Lead / Communication +// subject, sender, description +frappe.send_message = function(opts, btn) { + return frappe.call({ + type: "POST", + method: "erpnext.templates.utils.send_message", + btn: btn, + args: opts, + callback: opts.callback + }); +}; + erpnext.subscribe_to_newsletter = function(opts, btn) { return frappe.call({ type: "POST", @@ -12,3 +24,6 @@ erpnext.subscribe_to_newsletter = function(opts, btn) { callback: opts.callback }); } + +// for backward compatibility +erpnext.send_message = frappe.send_message;