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

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

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

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

// for backward compatibility
influxerp.send_message = influxframework.send_message;
