One of the important features of the new email notifier is the template language. It allows users to configure notification email templates in a flexible way.
Template Block
A template could contain one or more blocks. A block is defined by an XML style tag <fmeblock></fmeblock>. If a template does not contain these starting and ending tags, it will be considered as one required block.
If the type attribute of a block is specified as optional, this block will not be included in the notification email content unless all the macros it contains have been fully resolved.
Sample usage:
<fmeblock type="optional">
FME transformation job {id} succeeded.
</fmeblock>
This block is only active if the {id} macro is resolved.
Keyword
A keyword is specified as {<keyword>}, and it can be referred anywhere in template blocks for multiple times. When a notification email is generated, keywords will be resolved as their actual values. The keywords and their values are supplied by FME Notification Service via notifications.
The typical keywords contained in a JOB_SUCCESS notification may include:
Sample usage of keywords:
<fmeblock type="optional">
Job {id} succeeded. The Engine status message is {StatusMessage}.
</fmeblock>
For more information about supported keywords in email templates, see Email Template Keywords.
Function
A function is a special operator starting with @ which performs certain action on given input parameter. The supported functions are:
Sample usage:
<fmeblock type="optional">
Click here to download the result:
{urlPrefix}{ResultRootDir}/{@getFileName(@zip(OutputLocation))}
</fmeblock>
Here the {@getFileName(@zip(OutputLocation))} is a chain call of two functions.
It first compresses the folder specified by macro OutputLocation and then returns the zip file name.
HTML Content
A template can be in plain text or HTML. The format is specified by the Email Format property of the subscriber. HTML tags can be defined inside or outside template blocks. Keywords can be used in HTML in the same manner as in plain text.
Sample usage:
<fmeblock type="optional">
Job {id} succeeded.<br>
This is a URL: <a href=”www.mycompany.com”>My Company</a>
</fmeblock>