The sender name and email address are set here (at the end of Woocommerce "Emails" setting tab:
This fields are passed through dedicated filters hook that allow you to change conditionally the values.
Here is an example conditionally restricted to "customer processing email notification":
// Change sender name
add_filter( 'woocommerce_email_from_name', function( $from_name, $wc_email ){
if( $wc_email->id == 'customer_processing_order' )
$from_name = 'Jack the Ripper';
return $from_name;
}, 10, 2 );
// Change sender adress
add_filter( 'woocommerce_email_from_address', function( $from_email, $wc_email ){
if( $wc_email->id == 'customer_processing_order' )
$from_email = '[email protected]';
return $from_email;
}, 10, 2 );
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and works.
Some other WC_Email Ids that you can use in your condition:
- 'customer_completed_order'
- 'customer_on_hold_order'
- 'customer_refunded_order'
- 'customer_new_account'
- 'new_order'
( admin notification )
- 'cancelled_order'
( admin notification )
- 'failed_order'
( admin notification )
woocommerce_email_from_address
filter as the second variable. That object will have anid
property that you can use to conditionally change the from address for specific emails. – Furthermore