• Resolved John

    (@vsourztesting)


    We are using the WooCommerce plugin version 7.2.2 on the website, and we are changing the order status using the below function in the webhook file.

    $order = wc_get_order( $orderId );
    $order->update_status($orderStatus);

    When we change “Completed” order status at that time, order status is updated with the particular order, but an email is not being sent to the customer.
    This feature is working fine with the previous WooCommerce version (6.6.1).
    If we manually change order status from the back office, then order status is updated and an email is sent to the customer.

    Could you let us know why we are facing this issue and how to fix it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    You can check using a plugin like the WP Mail logging, what you can do is install it, then create a test order, go to Wp-Admin > Tools > WP Mail Log to check if the email is being generated and sent out.

    When emails are not being sent, you can follow these recommendations as well:
    https://www.mailpoet.com/blog/woocommerce-email-not-sending/

    Let us know how this goes for you.

    Thread Starter John

    (@vsourztesting)

    Hi @ihereira,

    Thank you for your reply.

    We have checked the given URL, but it is not relevant for us.
    When we are changing the order status programmatically at that time, email is not sent.
    If we change the order status in the back office at that time, an email is sent to the customer.

    We debugged and discovered that when we changed the order status at that time, the “WC_Email_Customer_Completed_Order” class did not exist.

    Due to the above reasons, the completed email was not sent to the customer. Please confirm.

    Do we need to pass any additional parameters within the below function to send the completed email to the customer?

    $order->update_status($orderStatus);

    Thanks,

    Hi,

    To check this better, you can share the code snippet you are using to change the status and generate the email, that way I can test on my end.

    You can share it via https://pastebin.com/ and keep the pastebin link alive for some days while we check into it.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The Order Status email is not being sent’ is closed to new replies.