Skip to Content

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 06, 2018 at 06:03 PM

    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,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2016 at 09:24 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.