Define a script task that sends an email notification
In the example workflow, the person proposing the new term (the start user) is notified and the status of the term is set to Rejected if the voting result is negative. To accomplish this:
- Add a script task to the Start user lane.
- Provide a Name for the task, for example Notify requester.
- Add the following groovy code to the task:
def usersIds = users.getUserIds("role(Requester)"); if (usersIds.isEmpty()){ loggerApi.warn("No users to send a mail to, no mail will be sent"); } else { mail.sendMails(usersIds, "in-progress", null, execution); }