Using Sitecore List Manager API on CD

106 Views Asked by At

In Sitecore 10.1 we have a custom submit action that creates a new contact and adds it to a specific list based on some business conditions. However we found that the List Manager API is not working on CD, is there a way to enable it or alternative way to add a contact to a list from CD? Why its been disabled? https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-manager/the-list-manager-api.html

2

There are 2 best solutions below

0
On

Sitecore stores contact lists as marketing definitions. You can access contact lists programmatically through the List Manager API only on the CM instance, you can't use the List Manager API on CD instances because the List Manager application is disabled in this case. You have to use the Email Experience Manager Client API to manage subscriptions to lists in the List Manager.

Use the Subscribe() method in the ClientAPIService class, Sitecore.EmailCampaign.Cd.Services.ClientAPIService, to handle subscribes to your list. More details about how to use the EXM Client API for Sitecore version 10.1 you can find [here][1].

0
On

As an alternative option, we can use the xConnect Client APIs to add contact to Sitecore List Manager from CD instance. Check out an example on the Sitecore Official Documentation here or Check complete implementation on this blog