Email Template

e-Reminders add-on allows complete customization of email formatting.

For template syntax details, see Go HTML template package documentation.

The following data objects are available in template:

  • Name: Name of the report

  • FieldIds: Top level field names

  • IssueGroups: Issue groups

  • Issues: Found list of issues

  • TotalIssues: Number of issues found

  • JiraFields: Issue fields metadata

  • JiraUrl: Base URL to JIRA

  • ContactUser: Report owner

Sample HTML template:

{{$self := .}}
<h2>Simple issues list:</h2>
<ul>
{{range .Issues}}
<li>
<a href="{{$self.JiraUrl}}/browse/{{.Key}}">{{.Key}}</a> ({{.FieldValue "issuetype.name"}})
assigned to {{.FieldValue "assignee.name"}}
<br/>Date formatting examples:
<br>* <em>updated.formatted.RFC1123</em>:
{{formatValueForReport .Fields "updated.formatted.RFC1123" $self.JiraFields}}
<br>* <em>updated.formatted with custom format</em>:
{{formatValueForReport .Fields "updated.formatted" $self.JiraFields "Jan _2 15:04:05 MST"}}
<br>* <em>updated.formatted with custom format and location</em>:
{{formatValueForReport .Fields "updated.formatted" $self.JiraFields "Jan _2 15:04:05 MST" "America/New_York"}}
</li>
{{end}}
</ul>
<h2>An example with grouping, showing all fields listed in UI:</h2>
{{range $sInd,$group := .IssuesGroups}}
{{if $group.Issues}}
<h4>{{$group.Name}}</h4>
<ul>
{{range $ind,$issue := $group.Issues}}
<li><a href="{{$self.Instance.BaseUrl}}/browse/{{$issue.Key}}">{{$issue.Key}}</a> {{$issue.Summary}}
{{range $key := $self.FieldIds}}
<br/>{{getFieldName $self.JiraFields $key}}:
{{formatValueForReport $issue.Fields $key $self.JiraFields}}
{{end}}
</li>
{{end}}
</ul>
{{end}}
{{end}}
comments powered by Disqus