• Resolved olliedc

    (@olliedc)


    I’ve built a new website using WordPress with the latest Divi Theme v4.8.2 and Mailpoet plugin v3.59.0. I’ve connected the Divi “Email Opt-In” module to Mailpoet (configured locally on the webserver). Everything works fine, except that when the user submits the form, they get the message:

    Subscription Error: This subscriber does not exist.

    … rather than the “Thank you, please check your email” type message. However the user is sent the confirmation email, and added to the Mailpoet database, so from that point of view, everything seems fine. If they click the Subscribe button a second time, they get the success message (and as the email has already been sent, they don’t appear to get a second copy).

    Has anyone else seen this, I can’t find a record of that error message alongside Mailpoet anywhere though Google or here? And any suggestions how to get around it?

    The form is very basic, just requesting firstname and emailaddress. reCAPTCHA3 is configured in the Divi plugin, but I’ve also tested it without and the same result.

    Many thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter olliedc

    (@olliedc)

    As an update, I’ve identified the cause of this issue as a bug in the Divi theme, not correctly handling the cause of the exception thrown when MailPoet API getSubscriber function is called. Rather than checking the code of the exception (APIException::SUBSCRIBER_NOT_EXISTS being a valid response when testing to see if the subscriber exists), it treats all exceptions as errors.

    I’ve raised this with the Divi support team.

    Hi, i also have this problem.
    How is this topic solved?

    Hello. I am having the same problem. How is this solved?

    • This reply was modified 3 years, 9 months ago by cristinadias7.

    Hi both… I’d thought it looked like a longstanding bug in the Divi theme and no one had been using it… so interesting a few others are also seeing it.

    The error message itself comes from line 357 of MailPoet’s API.php (/mailpoet/lib/API/MP/v1/API/php), in the function getSubscriber(); an exception is thrown when this function is called and the subscriber doesn’t exist.

    However the issue is not there, as that is correct behavior, but within the calling function within the Divi theme files, \Divi\core\components\api\email\_MailPoet3.php, line 165 within the subscribe() function. This should handle the exception gracefully as an expected response when the user is new.

    I’ve changed the code that checks if a subscriber already exists as follows:

    /**
    
    * Check if the subscriber with this email already exists.
    
    */
    
    try {
    
    $subscriber = \MailPoet\API\API::MP( 'v1' )->getSubscriber( $subscriber_data['email'] );
    
    } catch ( \MailPoet\API\MP\v1\APIException $exception ) {
    
    switch ($exception->GetCode()) {
    
    case \MailPoet\API\MP\v1\APIException::SUBSCRIBER_NOT_EXISTS:
    
    // valid result when subscriber does not exist; do nothing
    
    break;
    
    default:
    
    $result = $exception->getMessage();
    
    }
    
    } catch ( Exception $exception ) {
    
    $result = $exception->getMessage();
    
    }

    I’ve sent this to Elegant Themes in response to the ticket so hopefully they’ll patch a subsequent version of Divi directly.

    I’ve not looked at putting this into a child theme, but I guess that would be the right way to temporarily fix this until Divi to issue an update.

    • This reply was modified 3 years, 9 months ago by olicuk. Reason: added further detail

    Hi Olicuk!

    Thanks for the update!.
    I don’t feel comfertable changing codes, cause I think I would mess it up.(;-)
    I hope Divi will react to your ticket and hope they will soon send a patch for this issue.

    Best regards, Chris.

    Hi Olicuk,

    For the record I also get this error.
    Hopefully Divi and MailPoet can resolve this between them.

    Regards, Steve

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Subscription Error: The subscriber does not exist’ is closed to new replies.