Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Additional recipients on woocommerce invoice

Tags:

woocommerce

Is there way to add additional recipients to woocommerce invoice mail. I have tried to use 'woocommerce_email_headers' hook, but it's not working:

add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2);

function mycustom_headers_filter_function($headers, $object) {
    $headers = array();
    $headers[] = 'Bcc: My Name <[email protected]>';
    $headers[] = 'Content-Type: text/html';
    return $headers;
}

Any advice?

like image 351
Bobz Avatar asked Dec 07 '25 08:12

Bobz


1 Answers

You can expand the function to include the order as well:

add_filter( 'woocommerce_email_headers', 'woo_cc_emails', 10, 3 );

function woo_cc_emails( $headers, $status, $object ) {
    return 'Bcc: [email protected]' . "\r\n";
}
like image 126
adamj Avatar answered Dec 09 '25 18:12

adamj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!