Rey Rahadian
Rey Rahadian

Reputation: 455

Sitecore ECM - Unsubscribe from newsletter

i'm using Sitecore ECM to handle the newsletter subscribtion, what i want to know are if there are a way to unsubscribe a user from the newsletter through the code -not the unsubscribe link on the sent email-.

i found this function from Sitecore.EmailCampaign.dll

ClientApi.Unsubsribe(string campaignEventId) 

but it's asking for a campaign event id which i'm not sure where to find. Looking into the Sitecore ECM documentation also does not provide this information. And i would prefer i don't have to query the database directly to get the id

I'm sure there's much easier way to do this..

Upvotes: 1

Views: 1381

Answers (1)

Ivan Korshun
Ivan Korshun

Reputation: 321

Try TargetAudience.Unsubscribe().

Upvotes: 3

Related Questions