Mass Action: Send email to multiple people using standard SF functionality

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I want to send an email from a Skuid table to multiple selected people at the same time.

Tried hacking the url to include multiple email addresses using a mass action button but the email addresses are not being passed. I have the semi colon in there because that is how multiple bcc's are separated within SF.

Has anyone successfully configured the URL to send multiple emails?

URL: 
/_ui/core/email/author/EmailAuthor?rtype=003&p2_lkid=noreply@abc.com&p5={{{Email}}};
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
How are you getting the multiple email addresses together into one "Email" field? 
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
I thought through the mass action. I have the email field in the redirect url and the model so I thought it would pull it through the mass action the way it does with a row action. Is that not the case?
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
Thanks for the question Rob, it made me think and realize i was going about it the wrong way. I had to go the way of a snippet for this to work since the email addresses need to be in a colon-separated string. I re-purposed the snippet from this post and altered to suit my needs.

Final result:

// Get the Email of the selected items as an Array
var emailArray = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){ 

   return item.row.Email; 

});

// Convert this array to a colon-separated String

var emailString = emailArray.join(';');

// Redirect to Send Email page,
// passing in the Contact Email string
window.location.href = "/_ui/core/email/author/EmailAuthor?rtype=003" + "&p24=" + "noreply@abc.com" + "&p5=" + emailString;
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad you got it working.