Access the Recipient Email Address in a Template

Scenario

IssueEvent and UserEvent notifications will ( from 1.6.41 ) contain $recipientEmail, which is the text email address of the recipient, whether it is a JIRA user or an email only user.

For adHoc templates used in the JEMH post function, there can be many recipients in TO, CC and BCC fields. To cater for this, values will be available as String[], if present at all:

  • $recipientEmail_TO

  • $recipientEmail_CC

  • $recipientEmail_BCC

IssueEvent templates

TO recipient: $aRecipient

 

AdHoc templates

In order to get at the values, a loop is needed:

#if ($!recipientEmail_TO) TO recipients: #foreach ($aRecipient in $recipientEmail_TO) - $aRecipient #end #end

PLEASE NOTE:

Currently, only adhoc templates used in the JEMH post function can access recipients. Adhoc templates used in adhoc notifications are pre-rendered, meaning that recipients cannot be accessed.

There is an open feature request to enable adhoc templates used in adhoc notifications to access ‘settings’ including recipients https://thepluginpeople.atlassian.net/browse/JEMH-7502

 

Related articles