Send an invoice automatically with WooCommerce 2.x

The Question: “WooCommerce only sends invoice when triggered in the Dashboard. How to send these invoice automatically?”. 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();


2 Responses to “Send an invoice automatically with WooCommerce 2.x”

  1. 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.




Leave a Reply

(will not be published)