// Copyright (c) 2015, SolutionERP LLC and Contributors
// License: GNU General Public License v3. See license.txt

if(!window.xhiveerp) window.xhiveerp = {};

// Add / update a new Lead / Communication
// subject, sender, description
xhiveframework.send_message = function(opts, btn) {
	return xhiveframework.call({
		type: "POST",
		method: "xhiveerp.templates.utils.send_message",
		btn: btn,
		args: opts,
		callback: opts.callback
	});
};

xhiveerp.subscribe_to_newsletter = function(opts, btn) {
	return xhiveframework.call({
		type: "POST",
		method: "xhiveframework.email.doctype.newsletter.newsletter.subscribe",
		btn: btn,
		args: {"email": opts.email},
		callback: opts.callback
	});
}

// for backward compatibility
xhiveerp.send_message = xhiveframework.send_message;
