• Resolved slavensracing

    (@slavensracing)


    Hello,

    We are looking to disable the New order email sent to the admin when an order changes status from “Pending” to “On hold”.

    Specifically, we only want the New order email sent to the admin when the status of an order changes from anything (“Pending” or “On hold”) to “Processing”.

    From research it seems this can only be done with a few lines of hard code but we can’t find a sample of code anywhere.

    Thank you,
    Slavens Racing

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    Upon checking our documentation, I could find a developer article that includes all the codes to remove WooCommerce Emails for order events. Here is the link to the article:

    https://docs.woocommerce.com/document/unhookremove-woocommerce-emails/

    Specifically, I believe that this is the one that would work for you:

    remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );

    I hope that helps ??

    Thread Starter slavensracing

    (@slavensracing)

    Hello,

    I have tested this out on our staging site and it is working to stop the New order email for “On hold” orders.

    I have one concern. We need the New order email to send when the order status changes from “On hold” to “Processing”. When testing with a dummy order, manually switching the order from “On hold” to “Processing” does not send a New order email.

    I am not sure if that function is already coded into WooCommerce when the order automatically switches from “On hold” to “Processing” when payment is received or if I need to add more code myself.

    -Slavens Racing

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Oh, I see! Well, by default, WooCommerce will send a Processing email order when changing the order status from On Hold to Processing, but not a New Order email.

    And yes, that would require quite a bit of additional coding. Please kindly note that this requires some custom coding – which goes beyond the scope of support we are able to provide in this forum.

    If you do require more help with the actual coding, we’d recommend you hire a developer who can take a look at this, quote you for their services, and help you add this feature to your site. We’d recommend getting in touch with a web developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

    Thread Starter slavensracing

    (@slavensracing)

    Ok,

    Thank you for all the information. We have a contracted developer that I will send this to. I was just hoping to get some of the easier coding done myself.

    Thank you again,

    Slavens Racing

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Thank you for letting me know. ??

    Great! If you have any further questions, you can start a new topic.

    Cheers.

    I’m sorry to bump this, but I just want to add that I’m working with someone who is also frustrated by this functionality. They’ve lost quite a lot of money due to credit card fraud, because they rely on these new order emails as a signal that it is safe to send an order. Apparently when a transaction is placed on hold, these new order emails are still dispatched.

    I’d really appreciate it if we as users had more control in WooCommerce over who emails are sent to, and when they’re sent. Is it possible that this could be added to WooCommerce?

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @tgp1994!

    You are welcome to open a request here https://github.com/woocommerce/woocommerce/issues/new/choose

    Cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable Pending to On-Hold New Order Notification Email’ is closed to new replies.