I'm building a custom prefs centre that updates Publication Lists via WSProxy. It includes an "Unsubscribe from all emails" option that updates the status on AllSubscribers to unsubscribed. So far, all working as expected.
When the "Unsubscribe from all emails" is unchecked, I have implemented the following code, with the intent to reactivate the subscriber:
var prox = new Script.Util.WSProxy();
var sub = {
SubscriberKey: subscriber_key,
EmailAddress: email,
Lists: [{
ID: all_subscribers_list_id,
Status: "Active"
}]
};
var options = {
SaveOptions: [{
PropertyName: "*",
SaveAction: "UpdateAdd"
}]
};
var result = prox.createItem("Subscriber", sub, options);
This API call is returning a successful result, including the correct ListID for AllSubscribers, however reviewing the Subscriber in Email Studio indicates they are still unsubscribed.
What am I missing?