Email templates
Last updated
Last updated
Customizable email templates have always been at the core of Jira Email This Issue. The ability to customize email templates and use different templates per projects and/or issue types was part of Version 1.0.
Version 5.1 has made the development of custom email templates easier than ever by introducing the built-in template editor feature. Using the template editor, you can easily add new templates, tailor them to your needs, test and publish them for use.
To add a new template, do the following:
1. Go to Email Templates under OUTGOING EMAILS.
2. Click the Add button.
3. Choose from the following options:
Create from Themes
Create from JIRA Templates
Note: Templates created from a base JIRA template or a theme are preloaded with content and a default look and layout.
Templates created from Themes are a new concept in Jira Email This Issue and have many advantages. Read more below.
Themes are templates for the email templates. Creating a template from a theme has the following advantages:
Templates can be edited using the build-in Rich Text Editor or directly as HTML.
Templates can be fully customized as their layout and look-and-feel is not wrapped in Jira Velocity Macros.
Themes are based on Email This Issue's macro library.
There are dedicated themes available for Service Management Customer Notifications.
The following themes are available in Email This Issue:
Theme | Purpose |
---|---|
All Details | Renders all issue fields including all custom fields defined for the issue and all issue comments. |
Issue Commented | Prepared for Issue Commented notifications. |
Issue Modified | Prepared for Issue Updated notifications, renders the changelog and the entered comment. |
Work Logged | Prepared for Worklog-related notifications, renders the worklog and comment. |
Service Management Customer Invitation | Prepared for Service Management when customers are created automatically by Email This Issue. |
Service Management Auto Acknowledge | Prepared for Service Management to send auto-response emails. |
Service Management Request Participant Added | Prepared for Service Management when participants are added to a request. |
Service Management Request Created | Prepared for Service Management customer notifications when requests are created. |
Service Management Request Updated | Prepared for Service Management customer notifications when requests are modified. |
Service Management Request Resolved | Prepared for Service Management customer notifications when requests are resolved. |
Service Management Request Reopened | Prepared for Service Management customer notifications when requests are reopened. |
Service Management Request Commented | Prepared for Service Management customer notifications when requests are commented with a public comment. |
Empty | A general purpose minimalistic template. |
Issue List | Prepared to send issue lists in a single email from the Issue Navigator. |
Bounce Email | Templates created from this theme may be used to bounce back incoming emails. Read more about bounce emails here. |
To edit a template, do the following:
1. Go to Email Templates under OUTGOING EMAILS.
2. Click the three dots next to the name of a template and click Edit or Edit in HTML.
Templates have five major attributes:
Attribute | Requirement | Definition |
---|---|---|
Name | Mandatory | The name of the template. |
Description | Optional | The description of the template. |
Category | Optional | Template Categories are used to group templates and associate them with Contexts. |
Subject template | Optional | Defines the subject of the email. This field is supported by Velocity markup. |
HTML body template | Mandatory | This defines the body of your email if the email is in HTML format. |
Text body template | Mandatory | This defines the body of your emails if the email is in TEXT format. |
Note: Subject and body templates are developed using Velocity Macro syntax and HTML tags. They may include values of issue fields and custom fields.
Email templates based on Themes may be edited using the built-in Rich Text Editor. The Rich Text Editors comes with a WYSIWYG front-end making basic formatting with features such as the following:
Full screen editing
Preview
HTML source editing
To add fields to your subject or mail body templates, you can use the Field Picker. Pick a field from the list then copy and paste the generated velocity code to the template to have the value of the field rendered in the email.
Note: You can add issue or custom fields directly to the template using $customFieldManager
and $issue
in the Velocity Context, Field Picker just makes it a lot easier.
The Field Picker drop down contains:
Email Fields: The mail body and the mail subject the user enters manually. In case of a Send auto reply action these will represent the body and subject of the original email.
Issue Fields: All standard issue attributes.
Custom Fields: All custom fields.
Notification opt-out link: Insert this into your template to provide a link for the customer to opt-out from customer notifications.
Note: The Notification opt-out link feature is only available for Service Management projects and a prerequisite of this function is to have the Send Individual Emails option enabled in the Contexts settings.
Clicking on the link will result in switching off both Jira and Email This Issue customer notifications. It will not affect Issue Notifications in Email this issue e.g. An Issue commented notification will not be affected, while a Public comment added notification will be affected.
SINCE VERSION 8.0.4
You can now preview your template in the editor by using the preview tab on top of the page. The template preview result will be generated using the fields and details of the issue you specify here.
To see the Email preview, click the Preview button.
If you want a quick preview of the template while under Edit, press F9. This keyboard shortcut will either open the preview tab of the editor.
Important: Before a preview can be generated, you need to add the key of an existing issue in the Issue key field in order.
After the issue key has been entered, press the F9 key to immediately open the preview dialog from the Edit panel:
To close the dialog simply press the F9 key again or press Esc.
To further improve efficiency, the preview automatically detects which part of the template you are editing. If you are editing the HTML body, the preview shows the HTML format of the template, if you're editing in Text mode, the F9 preview generates the Text output of the template.
Once your finished with editing your template, click Save.
After creating a template, we recommend testing them before using them in projects.
To test a template, do the following:
1. Go to Email Templates under OUTGOING EMAILS.
2. Click the three dots next to the name of the template and choose Test.
3. Add the key of an existing issue.
4. (Optional): Enter some subject text and mail body.
5. Click Send to send out a test email right away to your email address, or click Preview to preview the email before clicking Send.
Once the templates are complete, they are available to be used for sending emails in various ways:
Select them as default templates for manual emails within a Contexts. Read more here.
Add them to Event Notifications. Read more here.
Select them in Workflow Post Functions. Read more here.
Select them to auto-acknowledgment emails by the Mail Handlers. Read more here.
Enhance your template with complex content. Read more here: