I’ve tried to fix the problem myself, using inspiration from another thread (https://ww.wp.xz.cn/support/topic/modification-to-allow-adding-to-lists/).
I’ve replaced the code around line 109 with the following, I tested it and it worked.
try {
$subscriberExists = \MailPoet\API\API::MP('v1')->getSubscriber($subscriber_data['email']);
} catch(Exception $exception) {
if ( $subscriberExists == '' ) {
try {
$subscriber = \MailPoet\API\API::MP('v1')->addSubscriber($subscriber_data, $mailpoetlists);
} catch (Exception $exception) {
// return $exception->getMessage();
}
}
}
if ($subscriberExists != '' ) {
try {
$subscriber = \MailPoet\API\API::MP('v1')->subscribeToLists($subscriber_data['email'], $mailpoetlists);
} catch (Exception $exception) {
// return $exception->getMessage();
}
}
Hi @kveelenturf,
There is no word to thank you for your help. A new version has been released. Please let me know if you have any problem.
Thanks