Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Using templates for emails

If a custom implementation for the email converter interface is not defined, the SMTP endpoint uses a the default one, which is based on Apache Velocity. Velocity is a Java template engine with simple but powerful syntaxessyntax.

This converter may transform either a MessageEvent with FIX messages inside or an AppEvent if it was routed to an STMP endpointThe converter puts the received MessageEvent object and all its header fields to the template context as shown in the table below:

Variable nameVariable typeDescription
eventMessageEventoriginal Original MessageEvent for converting to email.

Predefined header field. Contains the The source AppEvent instance (like NewSessionEvent) in case, if it was sent from a business rule to an STMP routed to SMTP endpoint.

email.templateStringPredefined header field. Custom template name. Can be set via the MessageEvent#setHeader() field. 
email.subjectStringPredefined header field. Custom email subject. Can be set via the MessageEvent#setHeader() field. 

The path to the template should be defined with the template property in the configuration of the SMTP endpoint configuration. In the case where If the template is placed into the conf directory, the path can be relative: