Configuring the token map
Control how tokens are replaced with the data, EXM uses a token map class, which binds tokens and recipient profiles.
You can use tokens, or replaceable parameters, in EXM email campaigns to provide values for recipient data whose actual values are not known at the time the email campaign is created.
To control how tokens are replaced with the information, the Email Experience Manager uses a token map class that describes bindings between tokens and properties of a recipient profile. This class must extend the Sitecore.Modules.EmailCampaign.Core.Personalization.RecipientPropertyTokenMap
abstract base class.
You can configure the token map in the Sitecore.EmailExperience.Core.config
file:
<recipients> <recipientPropertyTokenMap type="Sitecore.Modules.EmailCampaign.Core.Personalization.DefaultRecipientPropertyTokenMap, Sitecore.EmailCampaign" singleInstance="true" /> </recipients>
EXM recipients are xDB contacts, or they can come from your custom recipient repository.
The EXM module comes with the following default configuration of the token map and recipient repositories:
Token | Facet | Data populated for xDB contact |
---|---|---|
$fullname$ | PersonalInformation | Concatenation of the first, middle, and last name of the contact |
$name$ | PersonalInformation | The first name of the contact |
$firstname$ | ||
$lastname$ | PersonalInformation | The last name of the contact |
$email$ | EmailAddressList | The preferred email of the contact. |
$phone$ | PhoneNumberList | The preferred phone of the contact in the following format: |
To retrieve the default token map programmatically, use the following static method:
RecipientPropertyTokenMap.GetDefaultInstance();