I'm attempting to use the LogUnsubEvent() to mark the user as unsubscribed in the tracking job, but don't want the user to actually be unsubscribed from the All Subscribers.I'm sending from a Sendable Data Extension without using Publication Lists. I've tried the following script, where I perform the LogUnsubEvent() and afterwards perform the All Subscribers reactivation. It seems that the LogUnsubEvent() occurs too slowly, as I'm receiving an "OK" from the All Subscribers reactivation, but when looking at the subscriber in the All Subscribers, it's "Unsubscribed". I'm wondering if there was a way to delay the re-activation until after the LogUnsubEvent() has actually completed. I'm trying to avoid using Publication Lists if possible.
//Executing LogUnsubEvent
var subkey = "abc123"
var jobID = 132151
var listID = 51328
var batchID = 95538
var prox = new Script.Util.WSProxy();
var props = [{
Name: "SubscriberKey",
Value: subkey
},
{
Name: "JobID",
Value: jobID
},
{
Name: "ListID",
Value: listID
},
{
Name: "BatchID",
Value: batchID
},
{
Name: "Reason",
Value: "One click unsubscribe"
}
];
var logUnsubStatus = prox.execute(props, "LogUnsubEvent"); // StatusCode: "OK"; StatusMessage: "Event posted"
//Re-Activating subscriber
var subscriber = {
"Status": "Active"
};
var subObj = Subscriber.Init(subkey);
var subscriberReactivationStatus = subObj.Update(subscriber); // "OK"