Introduction
MailboxPro has two main email notifications which are sent out - the Created Issue
and Created Comment notification. These emails are sent in HTML and Plain Text formats,
and both are controlled by a template.
The purpose of this document is to describe how to customise these templates so
you can customise them to your organisation.
You will be able to include data from the original email, the Issue and if applicable
the new comment.
Getting Started
The templates are located in the Templates folder where you installed MailboxPro
and have the extension .vm. These can be edited with notepad, or any other text
or html editor.
The HTML versions are listed as:
<TemplateName>Html.vm, as an example NewIssueHtml.vmis the
html version and
NewIssue.vmis the plain text version.
You can include variables in these templates; a full list will be shown shortly.
The variables take the form:
$VariableName or, if part of a longer string, use curly brackets to identify the
variable within the string. ${VariableName}NextToLongerString.
Template Variables
General Variables
We’ve touched slightly in the quick-start section about how to use the variables,
and there really is not much more to it than that. The syntax is:
${VariableName}
but you can omit the {} if the VariableName is not adjacent to any other text characters
as a short-hand.
While $VariableName is valid, $VariableNameAndMore is not. The variable has been
changed to $VariableNameAndMore and this will of course be ignored. If you do want
to have the variable adjacent to other text, then you will need to use the full
${VariableName} syntax.
It is also worth noting that the variable names are CasE SenSiTivE.
Object Variables
These are variables which have many more properties attached. An example is simplest
to explain.
${email.Subject}
will put the email subject as it was received in the template.
There are three main objects, email, issue and comment. Comment is only available
in the Create Comment issue template.
Conditional
It is possible to show certain parts of the template, based on conditions. The syntax
is as follows:
#if(condition)
STUFF
#else
NOSTUFF
#end
If the condition is met, then the STUFF is written out within the template, otherwise,
NOSTUFF is written.
An example based on the variables might be:
#if(email.ProcessEmailMode == 2)
Email was sent CC!
#else
Email was not sent CC!
#end
Looping
It is possible to loop through the lists and collections from the various objects,
providing the data has been provided.
<ul>
#foreach($item in $collection)
<li>$item.SomeProperty</li>
#end
</ul>
This above example is probably sufficient, but let’s see a real example. Let’s say
we want to list all the attachments from an email:
<h2>Attachments included in the email</h2>
<ul>
#foreach($attachment in $email.Attachments)
<li>$attachment.FileName</li>
#end
</ul>
Ok, so this looks fairly straightforward, but what happens if there are no attachments
from the email. We could wrap it in a conditional statement, and check the .count
property of the attachment collection, but it could become complex. Thankfully,
there are some advanced looping options. We’ll use these in the example, and then
show the list of all possible looping options for reference.
#foreach($attachment in $email.Attachments)
#nodata
<p>There were no Attachments with this email</p>
#beforeall
<h2>Attachments included in the email</h2>
<ul>
#each
<li>$attachment.FileName</li>
#afterall
</ul>
#end
This is the most likely usage of looping, but it can get even more advanced. Here
is the same example, using every option available!
#foreach($attachment in $email.Attachments)
#nodata
<p>There were no Attachments with this email</p>
#beforeall
<h2>Attachments included in the email</h2>
<table>
<tr>
<th>Attachment Name</th>
</tr>
#before
<tr
#odd
Style='color:blue>
#even
Style='color:black>
#each
<td>$attachment.FileName</td>
#after
</tr>
#between
<tr><td><hr /></td></tr>
#afterall
</table>
#end
Generic
|
Variable
|
Description
|
|
$replyaboveline
|
Line where all is truncated below
|
|
$geminiurl
|
Url to Gemini
|
|
$projectid
|
issue or comment’s project id
|
|
$issueid
|
newly created, or commented issue
|
|
|
|
Email
|
EmailID
|
Unique MailboxPro identifier of the email
|
|
FromAddress
|
Who the email was from
|
|
FromName
|
Who the email was to
|
|
ToAddresses
|
List of Addresses in TO field, separated by ;
|
|
CCAddresses
|
List of Addresses in CC field, separated by ;
|
|
Priority
|
Priority value for the email:
High = 1, Normal = 2,Low = 3
|
|
EmailDate
|
Date of the email
|
|
Body
|
Html body
|
|
PlainTextBody
|
Plain text body
|
|
Subject
|
The subject line of the email
|
|
ImportDate
|
Date the email was imported
|
|
State
|
State of the email:
UnRead = 1, InProcessing = 2, Processed = 3, Pending = 4, Deleted = 5, BlackListed
= 6, Errored = 7
|
|
ProcessEmailAccount
|
The email address of the processing account
|
|
GeminiIssueID
|
The Gemini issue Id of the Issue, or Comment
|
|
GeminiCommentID
|
If the email was converted to a comment, this is the ID of the comment (null otherwise)
|
|
OriginalMessageId
|
Message ID of the email
|
|
ProcessedDate
|
Date the email was processed
|
Issue
The following are found under the $issue object. $issue.ReportedBy
|
ReportedBy
|
User Id of the reporter
|
|
ProjectId
|
Project Id the issue belongs
|
|
IssueVisibility
|
Visibility group Id
|
|
GlobalGroupVisibility
|
Is the visibility group a global group?
|
|
Detail
|
Main text of the issue
|
|
IList<IGeminiAttachment> Attachments
|
See Attachments
|
|
ProjectCode
|
Project Code
|
|
ReportedByUsername
|
Who the user reporting the issue is
|
|
DateCreated
|
When the issue is created
|
|
IssueId
|
The Gemini Id of the issue created
|
|
IList<IGeminiComponent> Components
|
See Components
|
|
IssueType
|
The type Id assigned to the issue
|
|
IssuePriority
|
The priority Id assigned to the issue
|
|
IssueSummary
|
Issue title / summary
|
|
DateCreated
|
Date the issue was created in Gemini
|
|
FixedInVersion
|
Version the issue was resolved in
|
|
IssueResolution
|
What the resolution status of the issue is
|
|
RiskLevel
|
The risk level of the issue
|
|
IssueStatus
|
Status of the issue
|
|
IssueSeverity
|
Severity of the issue
|
|
GeminiEntity
|
From build 2104, this property is the Gemini Issue Entity. Please see the API documentation
for the specification of this object.
|
Attachments
#foreach($attachment in $issue.Attachments)
|
FileName
|
The name of the file
|
|
DateCreated
|
Date the file was downloaded
|
|
ContentType
|
Content type of the attachment
|
Components
#foreach($component in $issue.Components)
|
ComponentId
|
The component selected
|
|
ComponentName
|
The name of the component selected
|
Getting Gemini Entities
build (2104 +)