Created
October 20, 2020 12:48
-
-
Save MamaiRachid/95574a7cb6060993fcf2610e541b236f to your computer and use it in GitHub Desktop.
Unsubscribe contact from newsletterEmailConsent on Sales Cloud by creating a Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
/* Check if the contact is subscribed to the newsletterEmail_Consent */ | |
IF (@newsletterEmail_Consent != 'False') THEN | |
SET @timeNow = FormatDate(Now(),"iso") | |
SET @created_taskId= CreateSalesforceObject('Task',4,'WhoId', @subKey, 'Subject', 'Datapm:Unsubscribe', 'Description', '{"crCode":"100001"}', 'ActivityDate', @timeNow) | |
/* Update Consents Data Extension */ | |
UpsertData("Consents", 1, "SubscriberKey", @subKey, "NewsletterEmail_Consent", "False") | |
ENDIF | |
]%% | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment