blob: b5416065d79197633ae46a1a3d8b5753ba74eb55 [file] [log] [blame]
Anand Doshi885e0742015-03-03 14:55:30 +05301// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
Rushabh Mehtae67d1fb2013-08-05 14:59:54 +05302// License: GNU General Public License v3. See license.txt
3
Anand Doshi9a4a13c2013-12-31 17:38:21 +05304if(!window.erpnext) window.erpnext = {};
Rushabh Mehta173a0fd2012-12-14 16:39:27 +05305
Rushabh Mehtaa54cb242013-03-19 11:12:22 +05306// Add / update a new Lead / Communication
Rushabh Mehta173a0fd2012-12-14 16:39:27 +05307// subject, sender, description
Rushabh Mehta793ba6b2014-02-14 15:47:51 +05308frappe.send_message = function(opts, btn) {
9 return frappe.call({
Rushabh Mehtaa75efa72013-03-19 17:59:49 +053010 type: "POST",
Anand Doshi9a4a13c2013-12-31 17:38:21 +053011 method: "erpnext.templates.utils.send_message",
Anand Doshifb109ad2013-09-11 18:58:20 +053012 btn: btn,
Rushabh Mehtaa75efa72013-03-19 17:59:49 +053013 args: opts,
14 callback: opts.callback
Anand Doshiedbf3e12013-07-02 11:40:16 +053015 });
Anand Doshifb109ad2013-09-11 18:58:20 +053016};
17
Rushabh Mehtaf29a6182015-05-25 10:50:48 +053018erpnext.subscribe_to_newsletter = function(opts, btn) {
19 return frappe.call({
20 type: "POST",
Kanchan Chauhan65c8b5a2016-06-28 11:17:02 +053021 method: "frappe.email.doctype.newsletter.newsletter.subscribe",
Rushabh Mehtaf29a6182015-05-25 10:50:48 +053022 btn: btn,
23 args: {"email": opts.email},
24 callback: opts.callback
25 });
26}
27
Anand Doshifb109ad2013-09-11 18:58:20 +053028// for backward compatibility
Rushabh Mehtaf29a6182015-05-25 10:50:48 +053029erpnext.send_message = frappe.send_message;