Configuring the token map

Last updated Wednesday, June 1, 2016 in Email Experience Manager for Developer, Administrator

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 can either be Sitecore users or xDB contacts, or they can come from your custom recipient repository. The default EXM token map works with all the types of recipients, regardless of which recipient repository they come from.

The default EXM token map

The EXM module comes with the following default configuration of the token map and recipient repositories:

Token

EXM recipient property

Data populated for Sitecore user

Data populated for xDB contact

$fullname$

PersonalInfo.FullName

The full name of the user, which is the value of the Profile.Fullname property

Concatenation of the first, middle, and last name of the contact

$name$

PersonalInfo.FirstName

The value of the Name field on the user profile (if available)

The first name of the contact

$firstname$

$lastname$

PersonalInfo.LastName

Empty

The last name of the contact

$email$

Email.EmailAddress

The email of the user, which is the value of the Profile.Email property

The preferred email of the contact specified in the IContactEmailAddresses facet

$phone$

Phone.PhoneNumber

The value of the Phone field on the user profile (if available)

The preferred phone of the contact specified in the IContactPhoneNumbers facet in the following format: +{country code} {phone number} ({extension})

To retrieve the default token map programmatically, use the following static method:

RecipientPropertyTokenMap.GetDefaultInstance();

Send feedback about the documentation to docsite@sitecore.net.