user2215771
user2215771

Reputation: 239

Woocommerce BCC on order email to admin

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

Upvotes: 7

Views: 6842

Answers (1)

Ratnakar - StoreApps
Ratnakar - StoreApps

Reputation: 4351

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

Upvotes: 7

Related Questions