I created a one-click unsubscribe, which should ideally unsubscribe the Recipient from BOTH the List and the All Subscribers List. Also, it should capture the unsubscribe event in the Tracking Send.
Here's the code I wrote:
SET @lue = CreateObject("ExecuteRequest")
SetObjectProperty(@lue, "Name", "LogUnsubEvent")
SET @lue_prop = CreateObject("APIProperty")
SetObjectProperty(@lue_prop, "Name", "SubscriberKey")
SetObjectProperty(@lue_prop, "Value", @SubscriberKey)
AddObjectArrayItem(@lue, "Parameters", @lue_prop)
SET @lue_prop = CreateObject("APIProperty")
SetObjectProperty(@lue_prop, "Name", "JobID")
SetObjectProperty(@lue_prop, "Value", @JobID)
AddObjectArrayItem(@lue, "Parameters", @lue_prop)
SET @lue_statusCode = InvokeExecute(@lue, @overallStatus, @requestId)
SET @Response = Row(@lue_statusCode, 1)
SET @Status = Field(@Response, "StatusMessage")
SET @Error = Field(@Response, "ErrorCode")
It appears that I can't achieve my requirements with the code above.
Any help?
Thanks,