• Version 2.3.6

    Fix – returning true or false based on mail is sent or not.
    Tweak – add return statement on send method of WC_Emails class.

    Issue

    I am trying to send mail using

    $subject = 'WC Send Mail Test';
    
    // load the mailer
    $mailer = WC()->mailer();
    $send = $mailer->send( get_option( 'admin_email' ), $subject, $mailer->wrap_message( $subject, 'a test message' ), '', '' );
    if($send){
     echo "Sent";
    }else{
     echo "Not sent";
    }

    This function works fine but i’m not able to track mail is sent or not. $send is always NULL

    Above code is taken from http://develop.woothemes.com/woocommerce/2014/10/2-3-emails/

    This seems to be a bug

    https://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter Shravan Shrama

    (@shravanjbp)

    What i’m trying

    I’m trying to digging out the woocommerce code and find the woocommerce use this file to send email

    woocommerce/includes/class-wc-emails.php

    Around line no. 214 I found the send method.

    I have change the code

    $email->send( $to, $subject, $message, $headers, $attachments );

    to

    $return = $email->send( $to, $subject, $message, $headers, $attachments );
    return $return;

Viewing 1 replies (of 1 total)
  • The topic ‘Bug : WC 2.3.6 WC_Emails->send() function returning NULL’ is closed to new replies.