简体   繁体   中英

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

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: my_personal@email.com\r\n"; // replace my_personal@email.com with your email
    }
    return $headers;
}

This code is tested in WC 2.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM