1

Im trying to remove a subscriber from a suppression list, but when i execute the code, i get the status code as "OK" but the subscriber is not getting removed from the suppression list. Any idea what the issue is?

    %%[
SET @Sub = CreateObject("Subscriber")
        SetObjectProperty(@Sub,"EmailAddress","abhishek.j.mishra@xxx.com")
        SetObjectProperty(@Sub, "SubscriberKey","00Q0n000003NBMCEA4")

SET @objPubList = CreateObject("SubscriberList")
   SetObjectProperty(@objPubList, "Status", "Active")
   SetObjectProperty(@objPubList, "ID", "3909")
   SetObjectProperty(@objPubList, "Action", "delete")
   AddObjectArrayItem(@sub, "Lists", @objPubList)
SET @statusCode = InvokeDelete(@sub, @statusMsg, @errorCode)
]%%

%%=v(@statusCode)=%%
0

This worked for me. So, at the time of creating a SubscriberList object. You need to set a property as "Action is delete" and use InvokeUpdate instead of InvokeDelete.

  %%[
SET @Sub = CreateObject("Subscriber")
        SetObjectProperty(@Sub,"EmailAddress","abhishek.j.mishra@xxx.com")
        SetObjectProperty(@Sub, "SubscriberKey","00Q0n000003NBMCEA4")

SET @objPubList = CreateObject("SubscriberList")
   SetObjectProperty(@objPubList, "ID", "3909")
   SetObjectProperty(@objPubList, "Action", "delete")
   AddObjectArrayItem(@sub, "Lists", @objPubList)
SET @statusCode = InvokeUpdate(@sub, @statusMsg, @errorCode)
]%%

%%=v(@statusCode)=%%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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