Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Last active June 9, 2020 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zuzannamj/345be4b53918b88ae4d60987d30f4e28 to your computer and use it in GitHub Desktop.
Save zuzannamj/345be4b53918b88ae4d60987d30f4e28 to your computer and use it in GitHub Desktop.
<script runat="server">
Platform.Load("Core","1.1.1");
var subkey = Attribute.GetValue("_subscriberkey");
var jid = Attribute.GetValue("jobid");
var lid = Attribute.GetValue("listid");
var bid = Attribute.GetValue("_JobSubscriberBatchID");
var prox = new Script.Util.WSProxy();
var props = [
{ Name: "SubscriberKey", Value: subkey },
{ Name: "JobID", Value: jid },
{ Name: "ListID", Value: lid },
{ Name: "BatchID", Value: bid },
{ Name: "Reason", Value: "WSProxy one click unsubscribe" }
];
try{
var data = prox.execute(props, "LogUnsubEvent");
Write(Stringify(data));
}catch(e){
Write(Stringify(e));
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment