Recipient repositories

Last updated Monday, August 1, 2016 in Email Experience Manager for Developer

The Email Experience Manager can use various sources of recipients to send email campaigns, including both the sources provided by Sitecore and your own sources.

The EXM has two recipient repositories:

  • XdbRecipientRepository is connected to xDB contacts.
  • MultiRecipientRepository aggregates multiple internal repositories and enables the requesting of a recipient without specifying their location. This repository sends the request to internal repositories in a given order, until it retrieves the recipient.

A recipient repository implements the abstract base class RecipientRepository.

Retrieving a recipient

The RecipientRepository class provides the following methods to retrieve recipients:

  • To retrieve a full recipient profile with all the properties, use the GetRecipient method:

    GetRecipient([NotNull] RecipientId recipientId)

  • To retrieve a specific set or recipient properties, use the GetRecipientSpecific method and specify the properties that you need:

    GetRecipientSpecific([NotNull] RecipientId recipientId, [NotNull] IEnumerable<Type> propertyTypes)

    Creating certain types of properties requires an additional search in a database, which is time consuming and resource intensive. When you retrieve only the necessary properties, this lets you save time and repository resources.

A recipient repository can recognize a recipient ID of the corresponding type by its string representation and convert it into an instance of the RecipientId type. You must ensure that each type of recipient IDs has its unique and unambiguous string representation. To distinguish the default types of recipient IDs, EXM uses the following prefix:

  • xdb: – for xDB contacts.


The following method parses an input string and returns a RecipientId instance when it is parsed successfully:

ResolveRecipientId([CanBeNull] string input)

The default recipient repository

You can configure the default repository for the EXM module in the Sitecore.EmailExperience.Core.config file:

  <recipientRepository type="Sitecore.Modules.EmailCampaign.Recipients.MultiRecipientRepository, Sitecore.EmailCampaign" singleInstance="true">
    <Repositories hint="list:AddRepository">
      <xdbContacts type="Sitecore.Modules.EmailCampaign.Recipients.XdbRecipientRepository, Sitecore.EmailCampaign" singleInstance="true" />

To retrieve the default repository programmatically, use the following static method: