Skip to content

Instantly share code, notes, and snippets.

@grola
Last active Jan 27, 2018
Embed
What would you like to do?
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;
}
@grola
Copy link
Author

grola commented Jan 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment