When someone makes an order in woocommerce, you get an email of the order as the administrator. I'd like to add additional recipients for this email. However! I'd only like this extra BCC to be made on these exact mails. Not all the other mails going through.
What is said in this thread applies to all mails, and not specificly the order emails that the admin gets: Additional recipients on woocommerce invoice
Try this code:
add_filter( 'woocommerce_email_headers', 'add_bcc_to_wc_admin_new_order', 10, 3 );
function add_bcc_to_wc_admin_new_order( $headers = '', $id = '', $wc_email = array() ) {
if ( $id == 'new_order' ) {
$headers .= "Bcc: [email protected]\r\n"; // replace [email protected] with your email
}
return $headers;
}
This code is tested in WC 2.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With