Email Templates



The Email Templates screen allow you to create custom Email templates that are then used by one or more Mail Queues.





Velocity

Click on the question mark below the edit field for a list of standard velocity variable defined in the velocity context

Subject

The subject has the additional velocity variables defined:

Variable

Description

queue

The name of the queue

counter

The email counter number

date

The date of the email formatted as a string

subjects

A list of subjects as used in the email body

subjectCount

The number of subjects in the email

firstSubject

The first subject that will appear in the email. This is an object, so use methods to access, eg $firstSubject.getSubject()

getOrder()
getIssueKey()
getEventTypeId()
getSubject()
getAuthor()
getAuthorUrl()
getAvatarUrl()
getChangeDate()
getIssueTypeIconUrl()
getIssueTypeIconUrlDesc)(
getPiorityIconUrl()
getPriorityIconUrlDesc()


Generic Context

The Velocity Context expanded in 1.3.7 to include a literal copy from the JEMH Project, enabling many core JIRA services to be available, enabling lookup by issue key etc. At this time there is no dynamic inspection and linking to the API, this will be merged over at a later time.

Key

Type

url

baseurl

stringUtils

org.apache.commons.lang.StringUtils

padSize

20

i18n

 com.atlassian.jira.util.I18nHelper, applicable to recipient user

userManager

com.atlassian.jira.user.util.UserManager

groupManager

com.atlassian.jira.security.groups.GroupManager

watcherManager

com.atlassian.jira.issue.watchers.WatcherManager

issueManager

com.atlassian.jira.issue.IssueManager

wikiRenderer

com.atlassian.jira.issue.fields.renderer.JiraRendererPlugin

dateFormatter

SimpleDateFormatter of type DateTimeStyle.DATE_TIME_PICKER







Subject Example

This snippet uses the sorted list of uniqueIssueKeys in the digest, looks them up, and outputs the reporter user (ApplicationIUser type) Name

#foreach ($aKey in $uniqueKeyList) $aKey (reporter: $issueManager.getIssueObject($aKey).getReporter().getName() #end

Body Example

Example showing arbitrary issue retrieval

<h1>-- EMQ-2 reporter is $issueManager.getIssueObject("EMQ-2").getReporter().getName() -- </h1>