Skip to content

Commit

Permalink
revert: remove frappe.send_message (v14) (#34816)
Browse files Browse the repository at this point in the history
revert: remove frappe.send_message
  • Loading branch information
phot0n committed Apr 11, 2023
1 parent da913d4 commit 8a331e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 0 additions & 4 deletions erpnext/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions erpnext/public/js/website_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -12,3 +24,6 @@ erpnext.subscribe_to_newsletter = function(opts, btn) {
callback: opts.callback
});
}

// for backward compatibility
erpnext.send_message = frappe.send_message;

0 comments on commit 8a331e0

Please sign in to comment.