computeDate
function. The syntax of this function is:dateTrait
now
is used. In this context now
represents the date and time when the message is rendered and dispatched e.g. user.[traits.birthday]
.timePhrase
dateTrait
e.g. +1 hour
, +2 days
. This attribute is required even if you wish to display the current date: to do so, simply set the time phrase equal to 0.yyyy-MM-dd
, dd/MM/yy
.now
(omitting the dateTrait
property). We use 2018-06-10
for the example calculation below.2018-06-20
in the section where it is used in the message. dateTrait
property with the attributeuser.[traits.birthday]
. We use 1993-01-20
for the example calculation below.1993/01/20
in the section where it is used in the message. dateTrait
property with the attributeuser.[traits.birthday]
and the timePhrase
property with the value +10 days
. We use 1993-01-20
for the example calculation below.30/01/1993
in the section where it is used in the message. formatDigits
function. The syntax of this formatting function is:propertyName
[properties.price]
numberDecimals
2
decimalSeparator
,
thousandsSeparator
.
percentage
true
#includeProducts
or #findProduct
helper function.#findProduct
, we search for a particular sku
and format the result's [properties.price]
attribute. We use 2000
as the value of the product's price for the example below.2.000,00
in the section where it is used in the message. #findProduct
, we search for a particular sku
and format the result's [properties.discount]
attribute. We use 15
as the value of the product's price for the example below.15%
in the section where it is used in the message. trim
- used to remove whitespace around a stringsubstring
- used to display a substring of an existing stringattribute
{{user.[traits.email}}
[email protected]
as the value of the user's email attribute.[email protected]
in the section where it is used in the message. #findProduct
, we search for a particular sku
and format the result's [properties.name]
attribute. For the example below, we use iPhone 8 Plus
as the value of the product's name.iPhone 8 Plus
in the section where it is used in the message. propertyName
start
1
refers to the first character in the string, 3
to the third character.length
10
#findProduct
, we search for a particular sku
and format the result's [properties.description]
attribute. For the example below, we use the following value for the product description attribute:DESCRIPTION: iPhone 8 introduces an all‑new glass design. The world’s most popular camera, now even better. The most powerful and smartest chip ever in a smartphone.
DESCRIPTION:
part of the text, we use the following function and parameters:iPhone 8 introduces an all‑new glass design.
in the section where it is used in the message.