Skip to main content
Conga Support

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.

The use of JavaScript in Conga solutions is considered an advanced method, requiring JavaScript knowledge, and is not supported by Conga or the Conga support team. You are welcome to use this feature at your own risk.

Follow these steps to create the custom action:

  1. Click ActionGrid Setup.
  2. Select the object for which you want to create the custom action.
  3. Select the object Features tab.
  4. Click New Custom Action. The Custom Action screen appears.
  5. Delete the sample code from the Javascript field.
  6. Copy and paste the following code into the Javascript field.
  7. Copy the itemID value and paste it as the Action Name.
  8. Click OK.
/**
 * @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();
     }
   }
 });
  • Was this article helpful?