The Question: “WooCommerce only sends invoice when triggered in the Dashboard. How to send these invoice automatically?”. Stackexchange.com WordPress Development does not allow WooCommerce questions any more. That is why i post the answer for this question here.
Add an action to your woocommerce_order_status_completed_notification
or woocommerce_order_status_pending_to_processing_notification
in functions.php:
function sendinvoice($orderid) { $email = new WC_Email_Customer_Invoice(); $email->trigger($orderid); } add_action('woocommerce_order_status_completed_notification','sendinvoice');
Carlos
Hello, when I put the code in but its sent to me admin email. I would like it to be sent to customers that completed a order.
Any assistance would be greatly appreciated.
Thanks
Carlos
txtsd
This works on wordpress 3.x too!
gema
can you give me tutorial for doing this ? where I can found this actions woocommerce_order_status_completed_notification ?