How to add "Marketo Send Email" Mass Action to a Skuid Table?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I use a 3rd party app, Marketo, to send mass emails to my Contacts and Leads. This app includes an On-Click JavaScript List Button called "Send Marketo Email" that shows up on standard Salesforce List Views, that lets me choose records to send emails to, and then, when I click the button, it runs the On-Click JavaScript, which takes the Contact/Lead Ids, puts them into a String, and sends this string into the URL of a Marketo Visualforce Page.

How do I replicate this with Skuid, as a Mass Action in a Skuid Table on Contacts (or Leads)?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb

Posted 5 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Here is how to replicate this with a Skuid Mass Action.

1. Add a new JavaScript Resource of type "Inline (Snippet)" to your Skuid Page. For Snippet Name put "sendMarketoEmail".

For Snippet Body, copy in this code:



// Get the Ids of the selected items as an Array
var idsArray = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){
return item.row.Id;
});
// Convert this array to a comma-separated String
var idsString = idsArray.join(',');
// Encode the string
var encodedIdsString = encodeURIComponent(idsString);

// Redirect to the Marketo Send Email to Contacts page,
// passing in the Contact Ids string
window.top.location = "/apex/mkto_si__Send_Marketo_Email?contactType=Contact&contactIds=" + encodedIdsString +"&retUrl=" + encodeURIComponent(document.location.href);






2. Add a Mass Action, of type "Custom", to your Skuid Contacts Table.

For Label: "Send Marketo Email" (or whatever you want)
For Icon, I recommend "ui-silk-email-go"
For Snippet Name: "sendMarketoEmail"





3. Save your page, Preview, and you're done!



Photo of Shaik

Shaik

  • 370 Points 250 badge 2x thumb
Hi Zach,

Here we have Similar  problem, 
List button  from managed package( mailchimp), it navigate like screens below

S1: After selecting multiple records, when we click on Mailchimp button it redirect to screen2.


S2: after subscription, when we click on "back to list" then it will redirect to screen1 (tab).


Here is the page Url: 

https://mc4sf.cs14.visual.force.com/apex/SubscriptionsContactList?retURL=%2F003%3Ffcf%3D00BD0000006q99N&wrapMassAction=1&scontrolCaching=1

What type of parameters can i pass here(above url)?

How can I achieve this functionality?

Please help me out!


Thanks,
Shaik.
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
It looks to me as though your page URL is not complete.  This may be becauise you did not select any records,  or only selected one that had an email address. I say that because the "Lists" section of the export does not have any names populated.   If you select a series of valid records (ones that have email addresses)  is the page different,  do you get a comma separated array in the URL?  
Photo of Shaik

Shaik

  • 370 Points 250 badge 2x thumb
Hi Rob,

Thanks for you reply, It give same URL :(

S1:



S2:



URL:

mc4sf.cs14.visual.force.com/apex/SubscriptionsContactList?retURL=%2F003%3Ffcf%3D00BD0000006q99N&wrapMassAction=1&scontrolCaching=1

VF Page from Managed packaging 


Thanks,
Shaik.
(Edited)