Hi I have a custom unsubscribe page on which i have a checkbox with submit button.
By using these i want to unsubscribe the subscriber from All subscribers. I am using the below code code and getting 500 internal server error.
%%[
IF not empty(requestParameter("submit")) THEN
//SET @subkey = RequestParameter("Subscriberkey")
// SET @email = RequestParameter("EmailAddress")
SET @subkey = "hardcoded for testing"
SET @email = "hardcoded for testing"
/* Unsubscribe Subscriber in ET All Subscribers */
SET @sub = CreateObject("Subscriber")
SetObjectProperty(@sub,"SubscriberKey", @subkey)
SetObjectProperty(@sub,"Status", "Unsubscribed")
Set @options = CreateObject("UpdateOptions")
Set @save = CreateObject("SaveOption")
SetObjectProperty(@save,"SaveAction","UpdateAdd")
SetObjectProperty(@save,"PropertyName","*")
AddObjectArrayItem(@options,"SaveOptions", @save)
/* Here is where we actually update the Subscriber object */
Set @ll_statusCode = InvokeUpdate(@sub, @ll_statusMsg, @update_sub_errorcode, @options)
IF @ll_statusCode == "OK" THEN
Redirect("https://pub.s4.exacttarget.com/ts2vjt4qghl")
ELSE
RaiseError(@ll_statusMsg, 0, @ll_statusCode, @errorCode)
ENDIF
ENDIF
]%%