Send a custom email to specific recipients
This workflow action will send a custom email to the specified recipients.
For example:
The action has three parameters:
- Recipients
are the email recipients (required), which can be specified as
- Users
- Groups
- Roles
- Member fields of the tracker item, that is subject/source of the triggering event
- Subject
The name of the Velocity template file for the email subject line (required)
- Content
The name of the Velocity template file for the email body/content (required)
The Velocity template files (*.vm) for the Subject and the Content, must reside in ~/CB-.../tomcat/webapps/cb/config/templates/email.
The Velocity context for both, the subject and the content/body template, contains the following information:
Variable | Type | Meaning |
user | UserDto | The user that executed the state transition that trigged this email |
subject | TrackerItemDto | The tracker item, that is subject of the triggering event and also of this email |
source | ArtifactDto | The source of the triggering event: a state transition, escalation rule, etc. |
tracker | TrackerDto | The tracker of the subject item |
project | ProjectDto | The project of the subject item |
transition | WorkflowTransitionDto | Only if the action was called from a state transition, otherwise false |
recipient | UserDto | The recipient of this email |
textFormatter | TextFormatter | A helper for locale specific formatting |
For example:
custom_example_email_subject.vm:
Dear ${recipient.realName}, please have a look at ${subject}
custom_example_email_body.vm:
#parse("notification_email_header.vm")
<div class="comment-box">
Dear ${recipient.realName}, <br/>
${user.realName} did ${source.name} #linkTrackerItem(${subject})
</div>
whatever that means to you ...
#parse("notification_email_footer.vm")