• Hi,

    I know by default that WooCommerce does not send Refund emails because refunding is, as Mike Jolley says, “a manual process” ( here: https://bit.ly/1uJTjDh )

    However, my Shop Managers want to be able to send one!

    My problem is: I can’t find a hook that will fire inside my extended email class to do this.

    Here’s what I’ve tried. I followed this tutorial, wrote a class and got everything working except that I need a hook to trigger it on refund:
    https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/

    I tried various hooks like woocommerce_order_status_refund in place of the ‘woocommerce_order_status_pending_to_processing_notification’ hook on line 39-40.

    The problem is that woocommerce_order_status_refund doesn’t trigger inside email class. It works fine elsewhere, but not in this context.

    I tried replacing the hook with woocommerce_order_actions_end as a sort of “generic”. I added an if (! $order->status == 'refunded') to filter for “refunded” only. But now the hook fired every time an order with a status of ‘refunded’ is loaded.

    I even tried adding a custom action with woocommerce_order_actions to the actions menu, but the problem is here I don’t know how to trigger my class with this. It seems to load before the class so that doesn’t work either.

    Is there anyway to do this or am I barking up the wrong tree completely?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Trigger Email on Refund Order’ is closed to new replies.