• Resolved kaicolson

    (@kaicolson)


    Trying to get woocommerce email add_filter to work.
    Doesn’t seem to work with WP Mail SMTP. How can I fix this?

    following code added into my functions.php file

    add_filter( 'woocommerce_email_from_address', function( $from_email, $wc_email ){
        if( $wc_email->id == 'customer_new_account' || $wc_email->id == 'customer_note' || $wc_email->id =='new_order')
            $from_email = '[email protected]';
            
        return $from_email;
    }, 10, 2 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @kaicolson,

    Thanks for reaching out. Could you please let me know the mailer you’re using and the ‘From Email’ you’re seeing in the email? It looks like the code snippet is modifying the ‘From Email’ and some mailers such as Gmail do not allow that.

    In the meantime, make sure you do not have the ‘Force From Email’ option checked in WP Mail SMTP which ignores other ‘From Email’.

    Regards,

    Hi @kaicolson – we haven’t heard from you in about a week, so I’m going to go ahead and mark this ticket resolved. If you still have questions, though, please feel welcome to continue the conversation.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Woocommerce emails’ is closed to new replies.