multiple recipients in single email alert - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Mehdi AMehdi A 

multiple recipients in single email alert

Hi,

I hae a question: if you have an email alert that has multiple recipients on it, does it send 1 email and includes all recipients or separate emails to each recipient? Is it possible to include all email recipients in a single email?

Best,
Mehdi
Best Answer chosen by Mehdi A
Usman AliUsman Ali
Hi Mehdi,

It will send a single email to all recipients copying them in email.

All Answers

sakshi nagpalsakshi nagpal
Hi Mehndi,

 If you have email alert with multiple receipients, All will receive same shared email

 You can use code for this-:
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();

for(String recipient :recipientEmailList) {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(recipient);
mail.setSubject(y);
mail.setHtmlBody(z);    
mails.add(mail);
}
Messaging.sendEmail(mails);
Usman AliUsman Ali
Hi Mehdi,

It will send a single email to all recipients copying them in email.
This was selected as the best answer
Mehdi AMehdi A
So all recipents are copied in one email?
Usman AliUsman Ali
Yes, In email alert select all recipients, they all will be in a single email.