• Resolved joy0114

    (@joy0114)


    Hi,

    Without having changed anything on my site, I have noticed a problem with sending emails.

    Or to be more precise, with triggering the sending of emails.

    When a new order is placed, no email is sent, neither the new order email (to the customer and the admin), nor any other email following the change in order status.

    In addition, a “fatal error” appears in the Woocommerce log, concerning this child template:

    Uncaught Error: Call to a member function get_order_number() on null in ……/woocommerce/emails/admin-cancelled-order.php:40

    Test emails are sent perfectly.

    Order emails sent manually work perfectly.

    However, as soon as Woocommerce needs to trigger an email, the above error occurs and nothing is sent.

    If I rename this child template so that the original Woocommerce template is used, the result is exactly the same: the system finds an error in the admin-cancelled-order.php template of the Woocommerce plugin.

    Where could this sudden problem be coming from ?

    Thank you in advance for your help !

    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @joy0114,

    Thanks for reaching out about this email issue. I can see you’re experiencing a frustrating problem where order emails aren’t being triggered automatically, even though manual emails work fine.

    The fatal error you’re seeing “Call to a member function get_order_number() on null” indicates that the email template is trying to access an order object that doesn’t exist or is null. This suggests there’s likely a conflict with your theme, custom code, or another plugin that’s interfering with how WooCommerce passes order data to the email templates.

    Since this started happening without any changes on your part, have you noticed any recent plugin updates, theme updates, or hosting changes that might coincide with when this issue began?

    To help troubleshoot this, I’d recommend checking your WooCommerce logs for any additional fatal errors and testing for conflicts by temporarily disabling other plugins to see if the issue resolves.

    Looking forward to your response.

    Thread Starter joy0114

    (@joy0114)

    Hi Frank,

    Thank you for your reply and for explaining the phenomenon.

    I haven’t been able to find the cause of this sudden behavior.

    So, for test orders where email notifications weren’t working, if I deleted them completely, I still got the “Fatal error” log that kept growing…

    With the same errors, every 4 minutes, then 6 minutes, then 4 minutes, and so on.., even though the order had been deleted.

    In short, I restored a recent backup, which was probably almost identical.
    And the problem disappeared !

    I would have liked to know why and how, but the problem is solved !

    Thank you for your advice, which I will keep in mind.

    Best regards

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi Joy,

    Thanks for the update. I’m really glad to hear the issue is now resolved on your end.

    From what we typically see, problems like this are often linked to general deliverability issues. However, we’ve also noticed a recent trend where order-related emails behave inconsistently. We’re still investigating that pattern, so your case adds helpful context.

    It’s great that restoring a recent backup resolved things on your site. Should the issue come up again, please try the suggestions we shared earlier and let us know the results. That information will help us continue digging into the underlying cause.

    If everything continues to run smoothly, we’d truly appreciate a quick review when you have a moment:
    https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

    Thanks again for your patience and collaboration.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.