• Resolved sanjas

    (@sanjas)


    Hi,

    it seems that after changing order status to custom status created with your plugin, other WooCommerce emails (when changing to default statuses) are no longer sent out.

    For example, we created status “Payment waiting” and a custom email template for it. Custom email is sent out perfectly, however, if we then change the order status to either “Processing” or “Completed”, default emails stop working. If we never use custom status, default emails work as expected.

    Hope you can help with the issue.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Nuggethon

    (@nuggethon)

    Hi @sanjas,

    1) Let us know if you are using any other plugins that have something to do with email sending in general.
    2) Could you enable WP Debugging (do not enable “WP_DEBUG_DISPLAY” option, only “WP_DEBUG_LOG” and “WP_DEBUG”). Here is a detailed guide on how to enable it. After enabling it replicate the issue and send us the debug.log file from root/wp-contents directory. Just to keep the support forum clean, please do not copy-paste the file contents here, attach a link to the file or send it via email at [email protected].

    Plugin Author Nuggethon

    (@nuggethon)

    Hi again @sanjas,

    there are a few more things we need from you:
    3) could you specify the exact steps you were taking before facing this issue and whether default emails are not sending at all, or only on the particular orders after changing them to the mentioned custom order status?
    4) About “Processing” order status, by WooCommerce default functions, the email for it gets triggered only when changing to “Processing” status from “Cancelled”, “Failed”, “On Hold” or “Payment pending” order statuses. Could you please check whether firstly setting order statuses to one of these solves the issue with “Processing”? If it does we will send you a code snippet with the permanent solution for it.

    When testing these steps, please test everything on a new Order.

    Thread Starter sanjas

    (@sanjas)

    @nuggethon sorry for the late reply.

    1) In general no. There’s one plugin though, which enables adding invoices to the WooCommerce emails, however, we did initial testings on the staging site where this plugin is disabled.

    2) Ok, I sent you the debug.log file on your email.

    3) If I make an order, I receive all the necessary emails. The problem occurs only after I set the order to the custom status. Example: I made an order using a bank transfer as payment so my order was in “on-hold” status and then I changed it to “payment waiting” status (custom status). I received both emails. When further changing the order status to “processing”, no email arrived.

    4) It does and now it makes sense why it didn’t work as expected. We would like to create a workflow where order statuses would go as followed: on-hold, payment waiting (if a customer doesn’t pay in x hours via bank transfer), followed by processing, and then completed. Is this possible with your shortcode?

    • This reply was modified 2 years, 4 months ago by sanjas.
    • This reply was modified 2 years, 4 months ago by sanjas.
    • This reply was modified 2 years, 4 months ago by Jan Dembowski.
    Plugin Author Nuggethon

    (@nuggethon)

    Hi @sanjas,

    the example snippet is provided for order status with slug ‘test-order-status’, so you will have to change it in every occurrence in the snippet to your order status slug (it can be found in the plugin’s settings page). The following snippet should be placed in your theme’s functions.php file:

    add_filter('woocommerce_email_actions', 'add_custom_email_action', 9999);
    
    function add_custom_email_action( $email_actions ) {
        $email_actions[] = 'woocommerce_order_status_test-order-status_to_processing';
        return $email_actions;
    }
    
    add_action('woocommerce_email', 'add_custom_email_trigger', 9999) ;
    
    function add_custom_email_trigger( $email_classes ) {
        add_action('woocommerce_order_status_test-order-status_to_processing_notification', array($email_classes->emails['WC_Email_Customer_Processing_Order'], 'trigger'));
    } 
    

    Regarding the “Completed” order status, currently, for us, it is working properly, while the issue with the “Processing” order status has occurred as well. It might get fixed once the snippet is applied.

    Let us know if the snippet helps, and if the “Completed” order status is still affected after the snippet we’ll try to find a way to solve that as well!

    • This reply was modified 2 years, 4 months ago by Nuggethon.
    Thread Starter sanjas

    (@sanjas)

    @nuggethon works perfectly now. Thank you!

    Plugin Author Nuggethon

    (@nuggethon)

    Did “Completed” order status got fixed as well? If so, I’ll mark this issue as resolved

    Thread Starter sanjas

    (@sanjas)

    Yes

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘After sending email from plugin, woo emails no longer work’ is closed to new replies.