-
-
Save rodrigofreitasit/e53aa6cbbcc0caedb63106ee2c6a5429 to your computer and use it in GitHub Desktop.
Use SSJS and WSProxy to add/update a subscriber status in Publication List within Salesforce Marketing Cloud
This file contains hidden or 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
<script runat="server"> | |
Platform.Load("core","1.1.1"); | |
var subkey = "abc123"; | |
var email = "[email protected]" | |
var prox = new Script.Util.WSProxy(); | |
// Set specific BU context if required | |
// prox.setClientId({ "ID": 7279411 }); | |
var sub = { | |
SubscriberKey: subkey, | |
EmailAddress: email, | |
Lists: [{ | |
ID: '12345', | |
Status: 'Active' | |
}] | |
}; | |
var options = { | |
SaveOptions: [{ | |
PropertyName: "*", | |
SaveAction: "UpdateAdd" | |
}] | |
}; | |
var resp = prox.createItem("Subscriber", sub, options); | |
Write("Response: " + Stringify(resp)); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.