2

I'm new to Salesforce development and specifically Exacttarget development. I need to write a custom opt-out page (that can be branded). So when a user clicks "Unsubscribe" they are taken to a company-branded Unsubscribe Page. I'm still working on the back-end code but the code that I have sort of works with ExactTarget. The problem is that it unsubscribes the user from ALL email lists an not just the list with the ID that I'm passing it. My php code is as follows:

$subKEY = "example@example.com";
$listID = "7682713";
$myclient = new ET_Client();
$subscriber = new ET_Subscriber();
$subscriber->authStub = $myclient;
$subscriber->props = array("ID" => $listID, "Status" => "Unsubscribed", "SubscriberKey" => $subKEY);
$results = $subscriber->patch();
print_r($results);

Is there a different syntax that is used for passing in a list ID?

0

I'd recommend taking a look at these two pages, specifically the SOAP envelopes toward the bottom that show how to set the List properties and statuses.

Managing Subscribers on Lists

Adding Subscribers to a List

Both of these pages are referenced in the Web Service Guide for the Subscriber Object.

The gist is that List is a property of the Subscriber object that has it's own attributes that you'll need to set to add/update list membership.

Subscriber Object SOAP sample

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.