This Is What To Do When WooCommerce Isn't Sending Emails on Cancelled Orders
One of the most frustrating experiences for an ecommerce store owner is when the website fails to send critical emails to customers. This is especially true for order cancellation notifications – when a customer cancels an order, both the merchant and the customer need to be informed promptly.
But what happens if those emails just… don't go out? This can lead to all sorts of problems, from unhappy customers who never receive an order confirmation, to merchants who are left in the dark about the status of their orders.
In this article, we'll dive into a common WooCommerce issue – failed order cancellation emails – and show you how to fix it. We'll cover:
- Why WooCommerce may not be sending order cancellation emails
- How to modify the order cancellation email recipients to include the customer
- Additional troubleshooting steps to ensure your WooCommerce emails are working properly
By the end, you'll have the tools you need to resolve this problem and keep your customers and business informed about order status changes.
Why WooCommerce May Not Be Sending Order Cancellation Emails
There are a few potential reasons why WooCommerce may not be sending order cancellation emails:
-
Email Delivery Issues: The first thing to consider is whether there's a problem with email delivery in general on your site. If no emails are being sent out, it's likely a broader issue with your WordPress or WooCommerce email settings.
-
Order Status Not Triggering Emails: WooCommerce has specific email triggers set up for different order statuses, like "Completed", "Failed", and "Cancelled". If the order is not properly transitioning to the "Cancelled" status, the corresponding email won't be sent.
-
Recipient List Missing the Customer: By default, the "Cancelled Order" email in WooCommerce only sends to the merchant/store admin. The customer's email address may need to be added to the recipient list.
In this article, we'll focus on that third issue – ensuring the customer's email is included in the "Cancelled Order" email recipients. But first, let's take a quick look at why this is important.
Why the Customer Should Receive the Cancelled Order Email
When a customer places an order and then needs to cancel it, it's critical that both the merchant and the customer receive notification. Here's why:
For the Customer
- The customer needs to know their order has been successfully cancelled so they can plan accordingly (e.g. pursue a different purchase, receive a refund, etc.).
- The cancellation email serves as a record of the transaction for the customer's records.
- If the customer doesn't receive a cancellation email, they may be left wondering about the status of their order, leading to potential frustration and poor customer experience.
For the Merchant
- The merchant needs to be aware of all cancelled orders so they can process refunds, update inventory, and manage their overall order fulfillment.
- Without a cancellation notification, the merchant may be left unaware that an order was cancelled, leading to potential issues down the line.
- Proactive communication around order cancellations helps maintain strong relationships with customers.
So in summary, sending the cancelled order notification to both the merchant and the customer is a critical step in providing a great customer experience and ensuring smooth order management.
How to Add the Customer Email to the Cancelled Order Email Recipients
Now that we understand the importance of including the customer in the cancelled order email, let's look at how to actually implement this in WooCommerce.
The good news is that there's a simple code snippet you can add to your WordPress theme's functions.php
file to achieve this:
/*
* 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 );
Here's how this code works:
- The
wc_cancelled_order_add_customer_email()
function takes two parameters: $recipient
(the default email recipient) and $order
(the WooCommerce order object).
- Inside the function, we're appending the customer's billing email address to the
$recipient
string, separated by a comma.
- The
add_filter()
function hooks this custom function into the woocommerce_email_recipient_cancelled_order
filter, which allows us to modify the recipient list for the "Cancelled Order" email.
By adding this code snippet to your functions.php
file, you'll ensure that both the merchant/store admin and the customer receive the cancelled order notification email.
Now, let's take a look at some additional troubleshooting steps you can take to ensure your WooCommerce emails are working properly.
Troubleshooting WooCommerce Email Delivery Issues
If you're still experiencing issues with WooCommerce emails not being sent, here are some additional troubleshooting steps you can take:
-
Check Your Email Settings: Ensure your WordPress and WooCommerce email settings are configured correctly. Go to WooCommerce > Settings > Emails and review the SMTP, From Name, and From Email settings.
-
Test Email Deliverability: Use a plugin like WP Mail SMTP to test if your site can successfully send emails. This will help you identify if the issue is with your server configuration or a plugin/theme conflict.
-
Inspect Email Logs: Check your site's email logs (if available) to see if the cancelled order emails are being generated but not delivered. This can help pinpoint where the breakdown is occurring.
-
Disable Email Sending Plugins: If you have any other email-related plugins installed, try temporarily disabling them to see if that resolves the issue. Conflicting plugins can sometimes interfere with WooCommerce's email functionality.
-
Update WooCommerce and WordPress: Ensure your WooCommerce and WordPress installations are up-to-date. Older versions may have bugs that impact email delivery.
-
Check Your Hosting Environment: If the above steps don't work, the issue may be with your web hosting provider. Reach out to their support team to see if there are any server-level configurations or restrictions impacting email sending.
By following these troubleshooting steps, you should be able to identify and resolve any broader email delivery problems on your WooCommerce site. And with the custom code snippet we provided earlier, you can rest assured that your customers will receive the critical order cancellation notifications they need.
In conclusion, if you're experiencing issues with WooCommerce not sending order cancellation emails, the solution is to modify the email recipient list to include the customer's billing email address. This simple code snippet will ensure both the merchant and the customer are kept informed about order status changes, leading to a better overall customer experience.
And don't forget, if you're looking for a powerful web analytics tool to help identify other technical, UX, and content issues impacting your WooCommerce store's conversion rates, be sure to check out Flowpoint.ai. Flowpoint's AI-driven insights can help you optimize your site and boost your bottom line.
Get a Free AI Website Audit
Automatically identify UX and content issues affecting your conversion rates with Flowpoint's comprehensive AI-driven website audit.