• After updating MailPoet we got an error – what should we do here?

    MailPoet 5.7.1/5.8.0

    Here is the source code:

    if (class_exists(\MailPoet\API\API::class)) {
    $mailpoet_api = \MailPoet\API\API::MP('v1');
    }
    try {
    $fil=array(
    'status'=>'subscribed',
    'listId'=>$listid
    );
    $subscribers = $mailpoet_api->getSubscribers($fil,500);
    } catch (\Exception $e) {
    echo 'error';
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ján Miklá?

    (@neosinner)

    Hi @wp_user1,

    Could you please share the exact error that you get? You can do so by removing the try{} catch() {} part and only calling the API, which should then surface the error.

    if (class_exists(\MailPoet\API\API::class)) {
    $mailpoet_api = \MailPoet\API\API::MP('v1');
    }
    $fil=array(
    'status'=>'subscribed',
    'listId'=>$listid
    );
    $subscribers = $mailpoet_api->getSubscribers($fil,500);
    Thread Starter wp_user1

    (@wp_user1)

    The class does not exist anymore since the last update. But I cannot find the new documentation.

    Plugin Author Ján Miklá?

    (@neosinner)

    @wp_user1 there were no changes in MailPoet API in 5.8.0, and the MailPoet\API\API class is still there.

    Could you please reinstall the plugin to ensure that some files are not missing? If that doesn’t work, could you please share the exact error (copy and paste it here please) that you see?

    Thread Starter wp_user1

    (@wp_user1)

    Fatal error: Uncaught Error: Call to a member function getSubscribers() on null in /var/www/html/_cron-newsletter.php:99
    Stack Trace
    1.
    {main}
    thrown in xxxx.php on line 99

    this is my error message.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.