Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wc_cancelled_order_add_customer_email( $recipient, $order ) {
- // Check if $order is null
- if ( is_a( $order, 'WC_Order' ) && ! is_null( $order->billing_email ) ) {
- // Append the billing email to the recipient list
- return $recipient . ',' . $order->billing_email;
- }
- // If $order is null or billing_email is null, return the original recipient
- return $recipient;
- }
- add_filter( 'woocommerce_email_recipient_cancelled_order', 'wc_cancelled_order_add_customer_email', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment