I'm creating a lightweight opt-out/profile center using the the Fuel SDK. My method is to use the email address a person inputs to retrieve the subscriber's ID. This ID will then be used to either update their profile with a new email address or unsubscribe them based on their selections in the form.
The problem is that when I retrieve a subscriber using the retrieve code for Fuel, I can't seem to assign the pertinent data to an actual variable. For instance:
$subscriber = new ET_Subscriber(); //Retrieve $subscriber->authStub = $myclient; $subscriber->props = array('EmailAddress', 'ID'); $subscriber->filter = array('Property' => 'EmailAddress','SimpleOperator' => 'equals','Value' => email@example.com); $response = $subscriber->get();
The code above will retrieve the subscriber info for the subscriber with firstname.lastname@example.org as their email. But what I need to do is assign the ID number of this selected subscriber to a variable. But the object type in $response is ET_Get which tells me it cannot be treated as an array. So how does one go about actually accessing the data so that I can make this pseudo code work:
$idNumber = $response->ID;
Any ideas? Thanks in advance!