How to do an Unsub event on a shared publication list?

I am working on a landing page, and right now, the code is all done in AMPScript (as that’s what I’m most comfortable with). I have a one-click unsub page that is working great, except for cases where the email was sent to a publication list that was a shared publication list. I already have a method to determine that

  1. The list is a publication list
  2. The list is top-level/ent

Existing code:

SET @ll_sub = CreateObject("Subscriber")
SetObjectProperty(@ll_sub,"EmailAddress", @SubscriberKey)
SetObjectProperty(@ll_sub, "SubscriberKey", @SubscriberKey)

set @subscription = CreateObject("SubscriberList")
SetObjectProperty( @subscription, "ID",@ListID)
SetObjectProperty( @subscription, "IDSpecified", "true")
SetObjectProperty( @subscription, "Status", "Unsubscribed" )
SetObjectProperty( @subscription, "StatusSpecified", "true" )     
AddObjectArrayItem( @ll_sub, "Lists", @subscription )

SET @ll_statusCode = InvokeUpdate(@ll_sub, @ll_statusMsg, @errorCode)

I have a @Flag variable that tells me if it is enterprise level or not, and I have a @Type variable that tells me if this is a group, list, or publication list.

Any thoughts on how to log an unsub event to this publication list when it is top level?

Thanks for your help!

Answer

You can define the parent BU MID in the SetObjectProperty and use a SimpleFilterPart for the Publication List ID:

SET @MID = "Account MID Here"
SET @clientID = CreateObject("ClientID")
SetObjectProperty(@clientID, "ID", @MID)

set @sfp = CreateObject("SimpleFilterPart")
SetObjectProperty(@sfp,"Property","ListID")
SetObjectProperty(@sfp,"SimpleOperator","equals")
AddObjectArrayItem(@sfp,"Value","Publication ListID Here")

Attribution
Source : Link , Question Author : Aaron Beatty , Answer Author : Jackson Chen

Leave a Comment