How to send an email to a candidate group on Activiti 6

cancel
Showing results for 
Search instead for 
Did you mean: 
matteo_zanardo
Active Member

How to send an email to a candidate group on Activiti 6

Good morning, I want to know how to send an email to notify all members of a group that I created.
Thanks in advance for the answer.

5 Replies
mdtabrezmca
Established Member II

Re: How to send an email to a candidate group on Activiti 6

Hi,

    As per my understanding

    If you want to send the notification using "User Task" then whoever you have assigned in the "Assignement" field of that task will be notified by email when the task is created.(In this case if you select "Assignement" as a group, an email notification to all the users in that group can be sent).You can check the documentation about the "User Task" and assignment here Activiti User Guide 

   If you want to send the separate email notification using "Email Task" then you can create a comman seperated list and assign to "To" field in the email task. for more detials about email task you can check the activiti documentation Activiti User Guide

matteo_zanardo
Active Member

Re: How to send an email to a candidate group on Activiti 6

Hi, I would like to send it as Mail task.
In the "To: " field instead of writing the various mail addresses, I wanted to know if there was a way to indicate the name of the group and make the system send the mail to the email addresses of the various users in the group automatically.

I do not know I am explained well

mdtabrezmca
Established Member II

Re: How to send an email to a candidate group on Activiti 6

I See what you are looking for but i cant find any thing relevent Funcationality which you can use to send the mail to a group directly.One thing i would suggest you to use Execution listener to do this job. You can check some of the test cases written for mail task here Activiti/modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/mail at 6.x · Acti... 

Which is clearly suggesting to use comma seperated value for this..........

agnishu
Active Member

Re: How to send an email to a candidate group on Activiti 6

the way i worked it out-

use email task

make it multi instance (parallel)

mention this in the collection - ${identityService.createUserQuery().memberOfGroup("your_group_name").list()}

element variable - user

To: ${user.getEmail()}

you can use user object in body as well to get the name.

this way you can send individual emails to everyone in the mentioned group.

abbask01
Established Member II

Re: How to send an email to a candidate group on Activiti 6

A quicker way would be to calculate the email addresses beforehand, then passing it as comma-separated string in the To attribute. Using the mail task synchronously, It would significantly reduce the time it takes to move from mail task to the next task in process, if the number of recipients are large.

Regards,
Abbas