Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce not sending Emails on cancelled order

I have a problem: my woocommerce won't send emails when I cancel an order, though the recipients is

{customer_email}

in the WC Email Settings.

I also tried adding my own mail address but it doesn't work too.

Furthermore I wonder why all other mails work..

Any help is appreciated! Thanks in advance

like image 887
davbuc Avatar asked Feb 08 '23 12:02

davbuc


2 Answers

Put this in your site's theme's functions.php:

/* 
 * Add customer email to Cancelled Order recipient list
 */
 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 );
like image 81
Rev. Samuel Avatar answered Feb 16 '23 10:02

Rev. Samuel


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 );
like image 44
Ranjeet Kumar Avatar answered Feb 16 '23 10:02

Ranjeet Kumar