Send new order email to additional reciepient wher coupon applied
<?php | |
add_filter( 'woocommerce_email_recipient_new_order', 'studiowp_woocommerce_email_recipient_new_order', 10, 2 ); | |
function studiowp_woocommerce_email_recipient_new_order( $recipient, $order ) { | |
$coupon_code = 'XXXXXXXX'; | |
$add_recipient = 'email@domain.com'; | |
if ( in_array( strtolower( $coupon_code ), $order->get_used_coupons() ) ) { | |
$recipient .= ',' . $add_recipient; | |
} | |
return $recipient; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Exploration for this code https://en.studiowp.net/send-new-order-email-additional-address-coupon-applied/