Marketo
Marketo is an e-mail marketing service that can be installed on a Salesforce org. You can also modify this example to send from other objects with e-mail address fields.
/**
* @author CRMCulture
* @version 1.00
* @description Custom Batch Email from Ooportunites.
*
* @param kendoEntry ActionGrid helper for Kendo UI modal entry forms.
* @param kendoPopup ActionGrid helper for Kendo UI model message windows.
* @param sfdc ActionGrid helper for Salesforce REST API's
*/
crmc.require(["KendoPopup", "sfdc" ], function(kendoPopup, sfdc) {
crmc.addCustomAction({
"itemID": "AG_MarketoEmail",
"isAvailable": function (context) {
var isSelected = context.selectedRows.length >= 1;
var isAccessable = this.featureSecurity.getSetting(context.objectDescribe.name, this.itemID) !== false;
var isCorrectObj = context.objectDescribe.name == "Lead";
return isSelected && isAccessable && isCorrectObj;
},
"getLabel": function (context) {
return "Send Marketo E-mail"; }, "createSubmenuItems": function (context) { return []; }, "click": function (context) { function processURL(){ var ids = []; var page = window.location.href; context.selectedRows.map(function(row) { ids.push(row.Id.substring(0,15)); }); window.open("/apex/mkto_si__Send_Marketo_Email?contactType=Lead&contactIds=" + ids.join() + "&retUrl=" + page); }; if(context.selectedRows.length > 5){ var buttons = [{ label: "Yes", click: function() { processURL(); } }, { label: "No" }]; kendoPopup.popupWithButtons("WARNING", "5 records are recommended because each item will show in a new tab. Do you want to continue?", buttons); } else{ processURL(); } } });
