How to send email to N number of people present in a group with a custom link containing their email id?

cancel
Showing results for 
Search instead for 
Did you mean: 
sreejith1
Member II

How to send email to N number of people present in a group with a custom link containing their email id?

Hi all,

I am doing a small POC in which I would be a fetching all the user's present in a particular group and sending a mail to all of them with a custom link as shown below:

localhost:8080/customCall/user/{userid}

where userid would be each user in the group. My mailing task is working for a single mail. Can you guys please shed some light on it. Hoping to hear from you soon.

P.S. I am using activiti-app, activiti-rest v6.0

7 Replies
jeffrosler
Partner

Re: How to send email to N number of people present in a group with a custom link containing their email id?

Assuming you want to do this as a step in your process, I'd suggest just creating a service task to send the emails. You can get the users in a group with the UserQuery class.

UserQuery query = identityService.createUserQuery().memberOfGroup("yourgroupid");
List<User> users = query.list();

Just iterate over the List and send an email for each user.

sreejith1
Member II

Re: How to send email to N number of people present in a group with a custom link containing their email id?

Hi Jeff,

I want to do this without using the API in my Java application, is it possible to solely use activiti-app or activiti-rest for this purpose?

jeffrosler
Partner

Re: How to send email to N number of people present in a group with a custom link containing their email id?

I'm a little unclear what you're asking. Can you explain how you're using activiti in your POC and where and when you want to send your emails?

sreejith1
Member II

Re: How to send email to N number of people present in a group with a custom link containing their email id?

I have deployed activiti-app.war, activiti-rest.war in apache tomcat and running it as a standalone application.

jeffrosler
Partner

Re: How to send email to N number of people present in a group with a custom link containing their email id?

And you're using it to do what?

sreejith1
Member II

Re: How to send email to N number of people present in a group with a custom link containing their email id?

I am trying to initiate a normal workflow where a mail would be send to all the people in a particular group and the person can approve or reject the task directly from the mail. I have configured MySQL as the backend.

jeffrosler
Partner

Re: How to send email to N number of people present in a group with a custom link containing their email id?

For that, you might look at this post How to design a process with a dynamic number of sub process tasks? or this one How to design a parallel group review workflow using Alfresco Activiti KickStart Designer App? As mentioned, use a user task and set the assignees based on the users in your group.

As far as approving/rejecting the task via an email, you might look at Ciju Joseph‌'s Email extension activiti-examples/aps-email-listener-extension at master · cijujoseph/activiti-examples · GitHub. I'd guess that should help do what you want.