• Hello,

    I have a WordPress website with premium content, and the Payment flow is being interfered by a Postman Plugin error.

    the error is on the line:

    $this->logger->debug( sprintf( ‘Saved message #%s to the database’, $post_id ) );

    with the error:

    “PHP Recoverable fatal error: Object of class WP_Error could not be converted to string in <HomeDir>/wp-content/plugins/post-smtp/Postman/Postman-Email-Log/PostmanEmailLogService.php on line 148”

    The reason for that error is that this line:

    “$post_id = wp_insert_post( $my_post, true );”

    returns WP_Error instead of the post ID, I suspect that this is an encoding problem(the $log->subject and $log->body contain Hebrew Characters).

    How can this issue be resolved?

    Your help is highly appreciated.
    Rotem

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have the same issue. How did you solve it? Thanks.

    Thread Starter blumbergrotem

    (@blumbergrotem)

    if (strpos($log->subject, ‘<the subject of the mail that causes error becuase of hebrew(I tracked it down by printing it to a debug log on wp_error)>’) !== false) {
    $my_post = array(
    ‘post_type’ => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG,
    ‘post_title’ => $log->subject,
    ‘post_content’ => ‘<replace the problematic content with a valid one(in my case it was not important for me to log all the content so I just placed the subject)>’,
    ‘post_excerpt’ => $new_status,
    ‘post_status’ => PostmanEmailLogService::POSTMAN_CUSTOM_POST_STATUS_PRIVATE,
    );
    } else{
    $my_post = array(
    ‘post_type’ => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG,
    ‘post_title’ => $log->subject,
    ‘post_content’ => $log->body,
    ‘post_excerpt’ => $new_status,
    ‘post_status’ => PostmanEmailLogService::POSTMAN_CUSTOM_POST_STATUS_PRIVATE,
    );
    }

    Rotem

    Thank you Rotem!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘error in inserting email to log’ is closed to new replies.