After clicking Create Token, a window appears, where you can select the type of token to be created.
Currently, contact personalization tokens are only available in English.
Contact data token can be used to include any data entry from the Emarsys contact database into your messages. Examples include, name, salutation or date of birth.
- Give a descriptive name to your token to make it easier to find it while using a content editor.
- Select the category you want to add the token to. A single token can be used in more than one category. You can also create a new category, for more information, see Creating a token category.
- Select the contact information to be used. All contact database fields are available for selection.
- This line shows a preview of the token and the Emarsys Scripting Language (ESL) code that is used for it. This code can be copied and inserted into blocks, too. For more information on ESL, see Emarsys Scripting Language.
- Check this box if you want to make sure that the message is not sent out if the personalization token cannot be populated.
- Add a fallback text that will be displayed if the value of the field cannot be obtained for some reason. Using a fallback text and marking the field as a requirement for sending are mutually exclusive.
- Here, you can add the formatting details of the token.
Note the information box about display settings override: this means that the settings you make here can be later overridden if needed at campaign-level.
Predefined Contact Data tokens
You can also access ready made personalization tokens by navigating to an editor's Personalization tab and selecting the relevant predefined token. You can drag and drop the tokens into your text blocks.
The following image shows some of the available predefined tokens. By using these, you do not have to check the Emarsys Scripting Language code ({{contact.<Field ID>}}
) each time when you want to insert a basic token.
Please note that single-choice system fields as token will only display their Value ID (a number). To successfully use them as a source for personalization, you have to add them into your campaign as ESL snippets.
{{ contact.label.9 }}
will display the title of the contact, if this field exists for it.
For more information on using ESL, see Emarsys Scripting Language and Using the Emarsys Scripting Language.
Using single choice fields in contact data tokens
Follow this pattern when creating an ESL token.
The following token returns the choice ID for the field X.
{{ contact.x }}
If you would like to see the actual choice instead of the ID of the choice, the following code works:
{{ contact.label.x }}
Example:
single choice
{{ contact.5 }} // 1 (returns only the choice ID for the given contact)
{{ contact.label.5 }} // male
Keep in mind, that you have to handle the tokens properly by its value:
- single choice fields returns only an ID, and label versions returns only one label. So handle them as a string/number/date.