Created
October 30, 2017 11:13
-
-
Save vanbo/e34f3ec144d547e88d71f56806d9cdb3 to your computer and use it in GitHub Desktop.
WooCommerce: Multiple recipients to "Processing Order" email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_email_recipient_customer_processing_order', 'prefix_add_recipients_to_processing_order_email', 10, 2 ); | |
/** | |
* @param string $recipient The recipient email, usually the billing address email | |
* @param WC_Order $order | |
* | |
* @return string | |
*/ | |
function prefix_add_recipients_to_processing_order_email( $recipient, $order ) { | |
// Add as many emails to the recipient as you want by separating them with "," | |
// Add the emails in the array | |
$emails = array( | |
'ad@asddd.com', | |
'admin@adminsssd.com', | |
); | |
if ( is_string( $recipient ) ) { | |
$emails[] = $recipient; | |
} elseif ( is_array( $recipient ) ) { | |
$emails = array_merge( $emails, $recipient ); | |
} | |
return implode( ',', $emails ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment