What is the Message Template Engine?
  • 04 Jun 2022
  • 2 Minutes to read
  • Dark
    Light
  • PDF

What is the Message Template Engine?

  • Dark
    Light
  • PDF

The Message Template Engine is a special-purpose text-based identifier that offers variables to create messages with dynamic content.

Here’s how it works: customer data is uploaded using engine variables. The system then displays the details that belong to each particular customer.

In other words, the message you send to each client will be personalized based on the parameters that you’ve specified you want to include — such as their name, gender, birthdate, bonus point balance, actions (e.g items they’ve browsed or added to their carts), orders, and more.

To visit the Parameters page, click CampaignsMessage Template Parameters:

00_tempengine

You can also open this section directly from the message editor:

01_tempengine

Details Available in the Parameters Section

Name

This is compiled by joining all the names end-to-end, with the target parameter name at the end.

For instance, to display the custom field Favorite color: сhoose the base parameter (Recipient), then a group of custom fields (AdditionalData), and only then the name of this custom field (which is Color in our case).

The final parameter name will include all these names joined by dots:
Recipient.AdditionalData.Color

02_tempengine

For details on how to render a parameter in a message, see this article.

Type

Data types can be grouped into two categories:

  • Primitive:

    • String
    • Date & time
    • Number
      • Integer
      • Decimal
    • Boolean
  • Composit:

    • Aggregate

Messages only support primitive data types, e.g., booleans in conditional statements.

All elements in aggregates consist of primitive fields. First, the user requests an aggregate element using the cycle @for...@end for. Then, the system populates relevant details into each element.

A customer (Recipient), a change in a customer’s balance (CustomerBalanceChange), and an order are implemented as sets of parameters. They belong to the composite data type but they are not aggregates. The user cannot display values of such parameters in a message directly. Instead, you have to call a string, number, or other values that are ’inside’ a given parameter.

For example, you cannot display a Recipient in a message as the system does not know which details the user is requesting.

However, the user can display a customer’s name (Recipient.FirstName — which is a "string" type of data) or their birthdate (Recipient.BirthDate, which falls into the "date & time" data category).

Description

A short description for your parameter to help you better understand what it refers to.

Accessibility

There are parameters that depend on events. These are not simply customer details. Instead, these parameters deal with details of a specific action, order, or website session. Parameters like this can only be used in tailor-made trigger scenarios that are launched after a specified trigger event.

Example:

03_tempengine

For more details on handling of such events and testing messages related to them, please see this article.

What Operators are Available

Operators that are available to handle given data depend on the type of this data.

— Logical connectives (and, or)

Available with all primitive data types

— Arithmetic operators: Addition (+), Subtraction (-), Multiplication (*), Division (/)

Available with all numbers

— Concatenation operator (&)

Available with all primitive data types

— Comparison operators (<, >)

Available with all numbers

— Equality operators (=, !=)

Depend on the data type. For more information, please refer to this article.