WooCommerce: Send Cancelled Order Email to Customers As Well

As per the WooCommerce settings, “Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold)“.

What’s not 100% clear, however, is that this email notification goes out to admins only (and additional email addresses, if entered in the email settings). Which means, the customer receives no cancelled order notification. So, let’s change this, and let’s add the customer email address to the list of people that receives this WooCommerce email.

The “Cancelled order” email notification is for WooCommerce admins only. But what if you want to send it also to customers?

PHP Snippet: Send Copy Of WooCommerce Cancelled Order Email to Customer

/**
 * @snippet       Add Customer to Cancelled Order Email Recipients
 * @tutorial      Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 8
 * @community     Join https://businessbloomer.com/club/
 */

add_filter( 'woocommerce_email_recipient_cancelled_order', 'bbloomer_cancelled_order_email_to_customer', 9999, 3 );
 
function bbloomer_cancelled_order_email_to_customer( $email_recipient, $email_object, $email ) {
   if ( is_admin() ) return $email_recipient;
   $email_recipient .= ', ' . $email_object->get_billing_email();
   return $email_recipient;
}

Mini-Plugin: Business Bloomer WooCommerce Add To: Cc: Bcc: Email Recipients

You don’t feel confident with coding? You need more control over your WooCommerce email recipients? You don’t want to purchase yet another bloated, expensive plugin? Great!

Business Bloomer WooCommerce Add To: Cc: Bcc: Email Recipients is a mini WooCommerce plugin, without the usual hassles. One feature. Lifetime license. No annoying subscriptions. 1 plugin file. A few lines of code. No banners. No up-sells. No WP notifications. Use it on as many websites as you like. Lifetime support. 1-page documentation. A single and easy admin dashboard.

Screenshot of the settings:

Quick demo? Here it is:

As you can see the settings are pretty straight forward. Simply add a comma separated list of email To: CC: and/or BCC: recipients to any active WooCommerce email. See the magic happen. Simple!

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

17 thoughts on “WooCommerce: Send Cancelled Order Email to Customers As Well

  1. Hi
    I have issues with this code also.
    The cancelled emails are sent to shop admin, but not to he clients. Fluent SMTP plugin is used.
    We have tested with three different test orders, no cancelled email came thru to costumer.
    Rgds / Johan

  2. The snippet doesn’t work if you manually cancel an order.
    Replace `if ( is_admin() )` by `if ( ! $emailObject )` and it will work in all circumstances.

    1. What do you mean “if you manually cancel an order”? Cancelled order emails trigger when status goes from Pending or On-Hold to Cancelled, no matter if manual or automatic… I just tested this by setting an order status which was previously “Processed” to “Cancelled” and the snippet worked perfectly

      1. I also had an issue with the is_admin check not firing, Tom’s solution worked.

  3. The first snippet is not really work, because there is no hook “woocommerce_email_recipient_cancelled_order”

    1. Sorry, but there is actually a hook. All WooCommerce emails use get_recipient(), and that function comes with the filter:

      'woocommerce_email_recipient_' . $this->id
  4. Hi Rodolfo,
    Thank you for this snippet. I have tried it on my website, but it doesn’t seem to CC the customer. The notification gets sent to me (site admin), but the customer does not receive anything when the order status changes to cancelled. Any ideas about what could be causing this or where I should start with troubleshooting? I can confirm SMTP is working as the email notification is coming to me (site admin). It’s only not sending to the customer’s email.

    1. Not 100% sure, billing email exists right?

  5. Unfortunately, it doesn’t work for me either.
    All other notifications are working and I do use an SMTP plugin .

  6. Will this work also for failed orders?

    1. Sure, you just need to change the “woocommerce_email_recipient_cancelled_order” hook!

  7. Hello Rodolfo,
    I have tried this snippet, but it doesn’t work. Nothing happens when the order is canceled, the confirmation email is not triggered.
    Can you have a look?
    Thank you.

    1. Works for me. Try with an SMTP plugin, and check the Woo Email FAQ here

  8. As usual, it seems simple trick but great help! Thanks a lot!

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *