Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vanbo/e34f3ec144d547e88d71f56806d9cdb3 to your computer and use it in GitHub Desktop.
Save vanbo/e34f3ec144d547e88d71f56806d9cdb3 to your computer and use it in GitHub Desktop.
WooCommerce: Multiple recipients to "Processing Order" email
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