Create your first template
To create a new template, simply press the button located at the top of the page. In the next screen you will see a form to edit your new template.
Info |
---|
You can also click in the Copy link in any of the templates in the Templates library. In this case a new template will be created based on the selected template and placed in the User made templates tab. Go there to edit it. |
Make sure to fill out the template's name, subject and add content to the HTML editor. If you wish to add any dynamic variables click the at the top of the page to get more help on what variables you can include or check the documentation.
The template screen shows you the Template Name, Description and Subject of the template. Also you have a full HTML editor for the source code and a live preview tab. Template Name and Subject are mandatory fields.
Notification templates are HTML templates that could have dynamics Velocity tags to include date from the related issue when sending notifications.
A very simple template would look like this:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<html>
<body>
<p><b>$user.displayName</b> has created a new issue with summary $issue.summary</p>
<p>$!issueDescHtml</p>
</body>
</html> |
This template will look like this when is used in a notification
Add fields and custom fields to the template
TemplateMe! allows you to easily add fields and custom fields to your template. Just click in the "View issue fields" to make TemplateMe! shows you all the availeble issue fields and custom fields. To add a given field just click in it and TemplateMe will add it to your template (using the custom field id).
Also TemplateMe! has an autocomplete feature. In the editor just click $ and let the editor show you your options:
When finished click the button find in the select list the field you want to add to the template and click the Add to template button:
For example we want to add the following fields to the simple template before: The issue project name, the issue key and the creation date.
Let's do this and reorder the fields in the template. Once done it would look like this:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<html>
<body>
<p><b>$user.displayName</b> has created a new issue with summary $issue.summary</p>
<p>Issue key: $!issue.key</p>
<p>Project key: $!issue.projectObject.key</p>
<p>Creation date: $!issue.created</p>
<p>Description: $!issueDescHtml</p>
</body>
</html> |
And the notification will look like this:
As you can see it is very easy to create a powerful template. From this simple template you can add custom fields, styles and so on to make your template be efficiente and look really professional. If you want to know what dynamic code could your insert in your templates, please look the available variables option.
When finished click the Update button to save your template.
Info | ||
---|---|---|
| ||
If you have also installed the NotifyMe! add-on app and want to TemplateMe! to display the text of the email in any place of your template, then simply add the |
Preview your template
In any moment you can preview your template by clicking the Preview tab in the manage template view:
Send a preview email
If you want to see how look your template using a real example you can click the Preview button. Please note that you have to save your template first. In the next screen select a existing issue and an user to send a preview email.
Delete, Edit or Copy a Template
After you have created a template, it will appear in the list of User made templates. At the right hand side of each template you can select any of the actions available. You can edit, copy or delete a template.
Note |
---|
Templates that are part of a Notification Scheme cannot be deleted. Default Templates that were added by the add-on can't be deleted either. |
Available
variables
Anchor | ||||
---|---|---|---|---|
|
When creating your templates you can use the following variables. These variables will be replace on the fly when sending notifications. TemplateMe! uses velocity templates in order to render the email content. You can know more about Velocity here.
Variable | Description | ||
---|---|---|---|
$!issue | The whole Jira issue. You can access al methods and properties of the issue. Example:
| ||
$!event | The notification event. Example:
| ||
$!user | The user that triggered the notification. Example:
| ||
$!project | The issue's project. Example:
| ||
$!comments | The Comment objects. Example:
| ||
$!baseurl | Jira base url. Useful for constructing url and links Example:
Renders like http://myjira.com/projects/projects/BNB/issues/BNB-143 | ||
$!currentTimestamp | The current date time Example:
Renders like Wed Aug 01 09:22:46 CEST 2018 | ||
$!dateTimeFormatter | Date formatter. Example:
Renders like 23/jul/18 1:19 PM | ||
$!lastComment | Last Comment object Example:
| ||
$!lastCommentText | Text of the last comment Example:
| ||
$!lastCommentHtml | Html styled content of the last comment Example:
| ||
$!lastCommentAuthor | Full name of the last comment Example:
| ||
$!issueType | Name of the issue type Example:
| ||
$!issueDescHtml | Html styled description of the issue Example:
| ||
$issueManager | Use the Atlassian's IssueManager class. Example:
|
How to insert complex code
Don't use the editor directly to insert complex code (for example a few lines of code). The editor will add invisible html characters and this will wreck the template.
If you want to add a few lines of code please use the Source code screen (Tools > Source code) to insert the code you want.$!customFieldManager | Use the Atlassian's customFieldManager class Example:
|