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

Internal Server Error when moving subscriber #51

@acuariano

Description

@acuariano

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions