Create a custom source definition

Current version: 9.2

You can create a custom source definition and manage them using the List Manager. The association between a list and a source is created automatically when at least one contact is added to a list using that source.

To create a custom source definition:

  1. On the Sitecore Launchpad, click Content Editor.

  2. Go to /sitecore/System/Marketing Control Panel/Subscriptions.

  3. In the tree view, right-click Subscriptions and click  Insert from Template.

  4. Expand the Templates/System/Analytics folder, click the Subscription item, and click Insert.

  5. On the Content tab, in the Name field, type the name you want to appear on the contact list page.

  6. To use the subscription across multiple contact lists, in the Tags field, define a shared value. Without a shared value, the life of the subscription source is tied to the contact list.

  7. Deploy the created subscription definition item.

You can subscribe a contact to a list with a custom subscription source using the following API:

RequestResponse
var contacts = new List<Contact>(); // List of contacts
var subscriptionService = ServiceLocator.ServiceProvider.GetService<ISubscriptionService>();
subscriptionService.Subscribe(contactListId, contacts, subscriptionSourceId);

Where subscriptionSourceId is the ID of a subscription definition item.

Do you have some feedback for us?

If you have suggestions for improving this article,