3

We are using a custom preference center and an automation that extracts contacts from our Master Permission DE, who have Opt-in set as 'false'. This DE that contains opt-outs is evaluated and later imported into All Subscribers list to unsubscribe them from further send-outs. Now, aside from using Automation Studio's SQL --> Data Extract > File Transfer --> Import Activity (into All Subscribers) flow, which has been buggy at best, is there a way to achieve this via Server-Side JavaScript? So, we would use SSJS in Automation Studio Script Activity on the DE where the opt-outs reside and have them unsubscribed from All Subscribers. Thanks

6

I did this before using SSJS the following way:

In your Script Activity using Marketing Cloud REST API endpoint to upsert values in the Data extension of your choice

https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/updateDataExtensionIDAsync.htm

To consume a REST endpoint in SSJS you can use Script.Util.HttpRequest to build and execute your request (explained in the documentation below)

Documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_platformContentSyndicationScriptUtilHttpRequest.htm

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.