Content Tokens allow a marketer to personalize messages. For example, an admin can put a token firstname into an email to display the member’s first name.
Content Tokens also allow a marketer to define simple, reusable bits of content, such as the “from” email address when sending mailings. Tokens support localization, so these bits of content can vary based on the member’s language preference.
Content Tokens can usually just be called “Tokens”. One could also think of them as “Dynamic Content Tokens”, since they are dynamic.
All tokens can be used in the content editor, either formatted as Token Elements or Merge Tokens. Tokens of type “merge” can contain the Merge Token syntax. The predefined system tokens are used implicitly in special places in the system, such as the Email From address.
The content editor will show a real-time preview of Test Members for all Token Elements.
Tokens can be inserted into content as Token Elements. These are valid DOM elements (such as a DIV, SPAN, or IMG tag) with a CSS class in the format “stl_token_
Examples:
Each token has an Apply To setting that defines how the value of a token will be applied to the Token Element.
Since the token variable will be used as part of a CSS class name, it is critical that the token variable be validated as a valid CSS class name when defined by the admin.
If the member attribute value is empty or null, then the token “Default Value” should be used instead, even if the default value is blank.
The Cheetah Digital Loyalty Content Token supports six types:
Merge Tokens can contain references to other Content Tokens, including conditional logic. The token value is built up as a merged string of several other tokens that are expanded inline in the outer string of the token definition, such as “Name: {{stl_token_firstname}} {{stl_token_lastname}}”.
Merge Token syntax surrounds each tokens variable in double curly braces, such as “{{stl_token_firstname}}”.
Merge Tokens use Handlebars syntax, which has conditional logic and can accommodate even complicated needs. For basic syntax, refer to: http://handlebarsjs.com/expressions.html. See below for various loyalty examples, some of which are quite advanced.
This example shows how to test multiple attribute values, using the first that is not empty.
{{#if stl_token_card_id}}{{stl_token_card_id}}
{{~else}}{{stl_token_loyalty_card_id}}{{/if}}
{{#if stl_token_card_id}}{{stl_card_id}}
{{~else if stl_token_card_id}}{{stl_card_id}}
{{~else}}#
{{~/if}}
Salutations can be constructed as Merge Tokens. Even formal salutations with nuanced and complicated social rules are possible.
Dear {{stl_token_first_name}},
{{#if stl_token_lastname~}}
{{~#if_eq stl_token_gender 'f'~}}
cara {{stl_token_lastname}}
{{~else~}}
caro {{stl_token_lastname}}
{{~/if_eq}}
{{~else~}}
caro
{{~/if}}
{{#if stl_token_lastname~}}
{{~#if_eq stl_token_gender 'm'~}}
Sehr geehrter Herr {{stl_token_academicdegree}} {{stl_token_lastname}}
{{~else if_eq stl_token_gender 'f'~}}
Sehr geehrte Frau {{stl_token_academicdegree}} {{stl_token_lastname}}
{{~else~}}
Sehr geehrte(r) Herr/ Frau {{stl_token_academicdegree}} {{stl_token_lastname}}
{{~/if_eq}}
{{~else~}}
Sehr geehrte Damen und Herren
{{~/if}}
The instructions for setting up the First Name content token are below:
The tokens listed below are commonly used by other programs. For your convenience, Cheetah Digital Loyalty automatically creates the tokens marked with an asterisk (*) but you can customize them as needed.
Token Name | Type | Setup |
---|---|---|
First Name * | Member Attribute | Member Attribute = First Name; Default Value = “Friend” |
Last Name | Member Attribute | Member Attribute = First Name; Default Value = “” |
Member ID * | Member Attribute | Member Attribute = Member ID |
Email * | Member Attribute | Member Attribute = Email |
Point Balance * | Metric | Metric = Point; Metric Value = Balance; Default Value = “0” |
Full Name | Merge Token | Value = “ ” |
Salutation | Merge Token | Value = “Dear , ” |
Program Name | Static | Value = “Loyalty Program” |
Support Email | Static | Value = “support@example.com” |
Support Phone | Static | Value = “(650) 555-1212” |
Program Home | Static | Value = “https://example.com”, Apply To = “Link” |
Cheetah Digital Loyalty has some content tokens with special behavior in Message Templates. These are not editable and do not appear in the list of content tokens.
Token Variable | Apply To | Behavior |
---|---|---|
stl_operational_hidden | element | Hides element if message setting Operational=true |
stl_web_version | link | links to the “web version” of the email message |
stl_unsubscribe | link | links to Communication Preferences content page. |