woocommerce coupon notifie a spefic email

Solutions on MaxInterview for woocommerce coupon notifie a spefic email by the best coders in the world

showing results for - "woocommerce coupon notifie a spefic email"
Sofia
21 Nov 2018
1add_action( 'woocommerce_applied_coupon', 'custom_email_on_applied_coupon', 10, 1 );
2function custom_email_on_applied_coupon( $coupon_code ){
3    if( $coupon_code == 'bob' ){
4
5        $to = "jack.hoover@gmail.com"; // Recipient
6        $subject = sprintf( __('Coupon "%s" has been applied'), $coupon_code );
7        $content = sprintf( __('The coupon code "%s" has been applied by a customer'), $coupon_code );
8
9        wp_mail( $to, $subject, $content );
10    }
11}
12