Personalization syntax personalization-syntax
Expressions in the Journey Optimizer B2B Edition personalization editor are based on the Handlebars templating syntax. It uses a template and an input object to generate HTML or other text formats. Handlebars templates look like regular text with embedded Handlebars expressions.
For more details about the Handlebars and how it works, refer to the HandlebarsJS documentation.
General rules
Simple expression example:
{{account.accountName}}
Where:
-
accountis a namespace. -
accountNameis a token composed by attributes.note note NOTE The attributes structure is defined in an Adobe Experience Platform XDM Schema. -
Identifiers can be any Unicode character except for the following:
code language-none Whitespace ! " # % & ' ( ) * + , . / ; < = > @ [ \ ] ^ ` { | } ~ -
The syntax is case sensitive.
-
The words true, false, null and undefined are only allowed in the first part of a path expression.
-
In Handlebars, the values returned by the {{expression}} are HTML-escaped. If the expression contains
&, the returned HTML-escaped output is generated as&. If you do not want Handlebars to escape a value, use the +triple-stash_. -
For literal functions arguments, the templating language parser does not support single unescaped backslash (
\) symbol. This character must be escaped with an additional backslash (\) symbol. For example :code language-none {%= regexGroup("abc@xyz.com","@(\\w+)", 1)%}
Helpers helpers-all
A Handlebars helper function is a simple identifier that can be appended with parameters. Each parameter is a Handlebars expression. These helpers can be accessed from any context in an email template.
{{#each account.accountOrganization.annualRevenue.amount}}
<li>{{this.name}}</li>
{{/each }}
For more detailed information about these functions, see Helper functions.
Literal types literal-types
Adobe Journey Optimizer B2B Edition supports the following literal types:
Examples:
"prospect", "jobs", "articles"Examples:
-201, 0, 412Note: You cannot directly access the properties of items within an array.
Examples:
[1, 4, 7], ["US", "FR"]