• Resolved Optimizing Matters

    (@optimizingmatters)


    Hiya all;
    2 Pretty technical questions;
    * are the mails that WooCommerce sends also triggering the normal WordPress actions and specifically template_redirect?
    * and if so; are there conditional tabs in the WooCommerce mail-handling logic that can be used to stop a plugin that hooks into template_redirect from acting on those mails?

    (context; I’m the developer of Autoptimize which hooks into template_redirect to start an output buffer and to parse the content of what is caught on the buffer to optimize the HTML, CSS & JS. I have one user who’s having issues with those mails and based on his tests this is AO’s doing)

    Looking forward to your feedback!
    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    Hey @optimizingmatters – I’m pretty sure that email sending is not hooked into template_redirect as that hook is for overriding the template that WordPress would normally choose to display something. The hook would be useful for displaying a custom archive page or a password reset form or something.

    The simplest test would be to add the following snippet:

    
    add_action('template_redirect', 'custom_logging_woo');
    
    function custom_logging_woo () {
    	//add debug logging here
    }
    

    Then, use tail -f debug.log to watch the log output and test by changing the order status in the backend which triggers emails.

    Thread Starter Optimizing Matters

    (@optimizingmatters)

    thanks for the feedback Thomas ??

    Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    @optimizingmatters – happy to help, good luck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘woocommerce mails going through actions?’ is closed to new replies.