• Resolved perituswebdesign

    (@perituswebdesign)


    Hi there,
    My emails are sent normally, but the function wp_mail return NULL. Therefore my script thinks, that wp_mail fails as it should return true/false. The script was working perfectly fine with an older version of your plugin.

    Thanks in advance,
    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter perituswebdesign

    (@perituswebdesign)

    Here’s the error-message I get:

    2017/12/06 07:46:15 [error] 49#49: *45 FastCGI sent in stderr: “PHP message: eemail::wp_mail_native: [email protected] (The Subject) Error: {“success”:true,”data”:{“transactionid”:”050d9112-418f-c1a3-e061-87830e66ba62″,”messageid”:”73NrEPYQNa1kECkkI5zwbQ2″}}” while reading response header from upstream, client: *.*.*.*, server: , request: “POST /path/to/php.php HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm.sock:”, host: “my.host”, referrer: “https://my.host/referrer”

    Thread Starter perituswebdesign

    (@perituswebdesign)

    I think your problem lies here:

    In eemail.php:26-29 you expect the return of eemail::send to be a boolean true, while in reality it is the json-body of the response.

    
    26:$rs = eemail::send($to, $subject, $message, $headers, $attachments);
    27:  if ($rs !== true) {
    28:    return eemail::wp_mail_native($to, $subject, $message, $headers, $attachments, $rs);
    29:  }
    

    In ElasticEmailClient.php:70 you simple return the response-body (which is json):

    
    70:  return $response['body'];
    

    The interesting thing is, that in ElasticEmailClient.php:68 you json_decode the response-body, but never use it. So I think you need to fix either ElasticEmailClient.php:70 to look like that:

    
    70:  return isset($jsonresponse['success']) ? $jsonresponse['success'] : false;
    

    or in eemail.php eemail::send to json-decode the body and return the success flag as boolean.

    I really hope this will be fixed very soon as I just gave you a solution.

    Thanks in advance.

    David

    Thread Starter perituswebdesign

    (@perituswebdesign)

    Was resolved with Version 1.0.3.

    Thanks a lot!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_mail is returning NULL’ is closed to new replies.