Anand Doshi | 885e074 | 2015-03-03 14:55:30 +0530 | [diff] [blame] | 1 | // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
Rushabh Mehta | e67d1fb | 2013-08-05 14:59:54 +0530 | [diff] [blame] | 2 | // License: GNU General Public License v3. See license.txt |
| 3 | |
Anand Doshi | 9a4a13c | 2013-12-31 17:38:21 +0530 | [diff] [blame] | 4 | if(!window.erpnext) window.erpnext = {}; |
Rushabh Mehta | 173a0fd | 2012-12-14 16:39:27 +0530 | [diff] [blame] | 5 | |
Rushabh Mehta | a54cb24 | 2013-03-19 11:12:22 +0530 | [diff] [blame] | 6 | // Add / update a new Lead / Communication |
Rushabh Mehta | 173a0fd | 2012-12-14 16:39:27 +0530 | [diff] [blame] | 7 | // subject, sender, description |
Rushabh Mehta | 793ba6b | 2014-02-14 15:47:51 +0530 | [diff] [blame] | 8 | frappe.send_message = function(opts, btn) { |
| 9 | return frappe.call({ |
Rushabh Mehta | a75efa7 | 2013-03-19 17:59:49 +0530 | [diff] [blame] | 10 | type: "POST", |
Anand Doshi | 9a4a13c | 2013-12-31 17:38:21 +0530 | [diff] [blame] | 11 | method: "erpnext.templates.utils.send_message", |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 12 | btn: btn, |
Rushabh Mehta | a75efa7 | 2013-03-19 17:59:49 +0530 | [diff] [blame] | 13 | args: opts, |
| 14 | callback: opts.callback |
Anand Doshi | edbf3e1 | 2013-07-02 11:40:16 +0530 | [diff] [blame] | 15 | }); |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 16 | }; |
| 17 | |
Rushabh Mehta | f29a618 | 2015-05-25 10:50:48 +0530 | [diff] [blame] | 18 | erpnext.subscribe_to_newsletter = function(opts, btn) { |
| 19 | return frappe.call({ |
| 20 | type: "POST", |
Kanchan Chauhan | 65c8b5a | 2016-06-28 11:17:02 +0530 | [diff] [blame] | 21 | method: "frappe.email.doctype.newsletter.newsletter.subscribe", |
Rushabh Mehta | f29a618 | 2015-05-25 10:50:48 +0530 | [diff] [blame] | 22 | btn: btn, |
| 23 | args: {"email": opts.email}, |
| 24 | callback: opts.callback |
| 25 | }); |
| 26 | } |
| 27 | |
Anand Doshi | fb109ad | 2013-09-11 18:58:20 +0530 | [diff] [blame] | 28 | // for backward compatibility |
Rushabh Mehta | f29a618 | 2015-05-25 10:50:48 +0530 | [diff] [blame] | 29 | erpnext.send_message = frappe.send_message; |