Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.
  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11091
    blanktobias-schfer
    Participant

    I’m faced with a little problem.
    I need to send the Customer Invoice / Order Details email automatically when an order is completed.

    I haven’t found any action or filter to apply in this case an the internet is not useful. Has anyone an idea how to send this email when the order status switches?

    Best regards!

    #11092
    blankozgur-sar
    Participant

    You can use woocommerce_order_status_completed hook and WC_Email_Customer_Invoice

    add_action( 'woocommerce_order_status_completed', 'mysite_woocommerce_order_status_completed', 10, 1);
    
    function mysite_woocommerce_order_status_completed( $order_id ) {
       // Send invoice email to customer
       //use order ID as trigger value
       WC()->mailer()->emails['WC_Email_Customer_Invoice']->trigger($order_id);
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.