Skip to content

Instantly share code, notes, and snippets.

@jfarsen
Created August 9, 2017 01:41
Show Gist options
  • Save jfarsen/3029fbcce5914a24bb5aae624e096065 to your computer and use it in GitHub Desktop.
Save jfarsen/3029fbcce5914a24bb5aae624e096065 to your computer and use it in GitHub Desktop.
Add bcc email on WooCommerce notifications
<?php
/*
* ajouter une autre adresse email sur les commandes et factures
* source : http://stackoverflow.com/questions/19810625/additional-recipients-on-woocommerce-invoice/21350340
*/
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment