function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Array of emails in batch question

I have a batch that sends out an email but it needs to send the email to only the people that fit the criteria created and each email contains a link specific to that person (a record they own). How should I do this with an array?
Shailendra Singh ParmarShailendra Singh Parmar
Hi Their,
I think you can use apprach that is discussed at What he is doing is
  1. Creating List of Messaging.SingleEmailMessage that include receipant in your case you will not add them in array instead create list of 
  2. After a loop he is calling Messaging.sendEmail(mails) to send email.