Email Template Language

An email template allows you to configure the body of a subscriber-generated email in a flexible way.

Template Block

A template can contain one or more blocks. A block is defined by XML style tag. If a template does not contain these starting and ending tags, it is treated as one block.

If the type attribute of a block is specified as optional, the block is not included in the notification email content unless all the macros it contains have been fully resolved.

Sample usage:

FME transformation job {id} succeeded.

In this case, the block is only active if the{id}macro is resolved.

Keywords

A keyword is specified as{}, and it can be referenced multiple times anywhere in a template block. When a notification email is generated, keywords are resolved to their actual values. Keywords and their values are supplied by FME Notification Service via notifications.

Every FME transformation job that generates a notification supports a set of standard keywords. Other keywords available for use are specific to theFME Flowservice that is invoked. For more information about supported keywords, seeEmail Template Keywords.

For example, the following JSON notification generated by the Data Download service:

{

"id":"2",

:“requestKeyword FILE_DOWNLOAD_SERVICE”,

"timeFinished":"Mon-15-Aug-2011 02:01:46 PM",

"timeRequested":"Mon-15-Aug-2011 02:01:45 PM",

"timeStarted":"Mon-15-Aug-2011 02:01:45 PM",

"LogFileName":"datadownload\\FME_7D150E1F_1313442105798_4244.log",

"NumFeaturesOutput":"49",

"OutputLocation":"\\\\Server\\FMEServer\\DefaultResults\\FME_7D150E1F_1313442105798_4244",

"ResultRootDir":"\\fmedatadownload\\results",

"StatusMessage":"Translation Successful",

"StatusNumber":"0"

}

Example: Using Keywords in Emails About Job Failure or Job Success

A JOB_FAILURE email subscriber might use theidandStatusMesssagekeywords to indicate which job has failed, and the reason:

Job {id} failed with the message: {StatusMessage}. Access the log file for this job on the Jobs page of theFME FlowWeb User Interface. Select the job from the Completed table. On the page for the job, view or download the log.

A JOB_SUCCESS email subscriber might use the same keywords for an email with this message body:

Job {id} succeeded. The Engine status message is {StatusMessage}.

Function

  • @getFileName: returns the file name only of a full file path.

Sample usage:

Click here to download the result:

{urlPrefix}{ResultRootDir}/{@getFileName(OutputLocation)}

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:

Job {id} succeeded.

This is a URL: My Company