Skip to content
Advertisement

Send failed order email notification to the customer in Woocommerce

I’m using the following code in my theme functions.php file to send order failed email only to customer instead of admin:

JavaScript

And it works…

But I’m getting the following error in php log file:

JavaScript

How can I solve this error?

Advertisement

Answer

You need to replace billing_email by the WC_Order method get_billing_email() like:

JavaScript

Code goes in function.php file of your active child theme (or active theme). Tested and works.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement