Skip to content
This repository has been archived by the owner on Aug 29, 2019. It is now read-only.

Internal Server Error when moving subscriber #51

Open
acuariano opened this issue Apr 14, 2016 · 0 comments
Open

Internal Server Error when moving subscriber #51

acuariano opened this issue Apr 14, 2016 · 0 comments

Comments

@acuariano
Copy link

I get an Internal Server Error when I try to move a subscriber. This the code I'm using:

function move_subscriber($account, $subscriber_email, $list_id)
{
        print "moving to list $list_id\n";
        $listURL = "/accounts/{$account->id}/lists/{$list_id}";
        $list = $account->loadFromUrl($listURL);
        print "list found<br/>\n";
        print "Destination list: " . $list->name . " (" .$list->id . ")" . "\n";
        $params = array('email' => $subscriber_email, 'status' => 'subscribed');
        $found_subscribers = $account->findSubscribers($params);
        print "Found " . count($found_subscribers) . " subscribers. Moving first...\n";
        print $found_subscribers[0]->name  . ", " . $found_subscribers[0]->email . "\n";
        $found_subscribers[0]->move($list);
}

From the prints I know I got the target list and subscriber. But the last line in the function throws an error with no information. I went to oath_application.php and modified code in line 483:

        if($resp->headers['Status-Code'] >= 400) {
            $data = json_decode($resp->body, true);
            $message = var_export($data, true);
            throw new Exception($message);
            //throw new AWeberAPIException($data['error'], $url);
        }

With that I found that it's returning a 500 Internal Server Error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant