private void ListManagerOperate()
{
// 获取服务
IClientApiService clientApiService = ServiceLocator.ServiceProvider.GetRequiredService<IClientApiService>();
// EXM manager root id
string managerRoot = Settings.GetSetting(Global.ExmRoot, "{C6AC22DB-90F2-4765-A383-78311E41BFF4}");
// optout list item id
string GlobalOptout = Settings.GetSetting("GlobalOptoutList", "{ADCC924D-DC6C-406C-B8C7-89A58F829871}");
ID managerRootId = new ID(managerRoot);
ID GlobalOptoutId = new ID(GlobalOptout);
// RemoveFromList:从 target list id 里移除此条数据
clientApiService.UpdateListSubscription(new UpdateListSubscriptionMessage()
{
ListSubscribeOperation = ListSubscribeOperation.RemoveFromList
// public enum ListSubscribeOperation
// {
// Subscribe,
// Unsubscribe,
// UnsubscribeFromAll,
// AddToList,
// RemoveFromList,
// }
, ContactIdentifier = new ContactIdentifier("form", "标识符", ContactIdentifierType.Known)
, ManagerRootId = managerRootId.Guid
, ListId = GlobalOptoutId.Guid
});
}
标签:GlobalOptout,ListSubscribeOperation,id,Sitecore,new,Operation,ListManagaer,ID,Re
From: https://www.cnblogs.com/fires/p/18080878