Skip to content

Instantly share code, notes, and snippets.

@AmeliaBriscoe
Last active November 22, 2021 03:33
Show Gist options
  • Save AmeliaBriscoe/0a5a9aa36c2c0d7824049535fdc2240e to your computer and use it in GitHub Desktop.
Save AmeliaBriscoe/0a5a9aa36c2c0d7824049535fdc2240e to your computer and use it in GitHub Desktop.
Send WooCommerce cancelled or failed order email to customers
<?php
/*
* add the customer to the recipient field for the WooCommerce Failed and Cancelled Order email
*/
function wc_cancelled_order_add_customer_email( $recipient, $order ){
return $recipient . ',' . $order->billing_email;
}
add_filter( 'woocommerce_email_recipient_cancelled_order', 'wc_cancelled_order_add_customer_email', 10, 2 );
add_filter( 'woocommerce_email_recipient_failed_order', 'wc_cancelled_order_add_customer_email', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment