cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure multiple recipients in email send through WCMS and Process engine.

nikhil-ku
Explorer
0 Kudos
 
Former Member
0 Kudos

Hi ,

Do you want to add an employee or another client to recipients?

Regards,
Artur

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Follow the below steps:

(1) Extend the DefaultEmailGenerationService and override createEmailMessage() method.

(2) In createEmailMessage() method, create toEmailList like below:

 List<EmailAddressModel> toEmailList = new ArrayList<EmailAddressModel> ();
 final EmailAddressModel email1 = 
 emailService.getOrCreateEmailAddressForEmail("email1@gmail.com", "DISPLAY_NAME");
 
 final EmailAddressModel email2 = 
 emailService.getOrCreateEmailAddressForEmail("email2@gmail.com", "DISPLAY_NAME");
 
 toEmailList.add(email1);
 
 toEmailList.add(email2);

(3) Now,call createEmailMessage() method of DefaultEmailService class by passing "toEmailList" as a parameter along with others parameter.

 return getEmailService().createEmailMessage(toEmails, new ArrayList(), new ArrayList<EmailAddressModel>(), fromAddress, emailContext.getFromEmail(), emailSubject, emailBody, null);
 

Thanks,

Former Member
0 Kudos

Hi Nikhil, You can create the List of EmailAddressModel and pass that to createEmailMessage() method of DefaultEmailService and you need to set the emails in the EmailAddressModel and pass that as ccAddresses in the above method.