0

I have a question regards delaying a WooCommerce Out of the box email notifications. We use WooCommerce Shipment tracking and also Dokan plugins. And therefore we also have suborders: A suborder has also a tracking code. We provide that information in the parent order processing mail.

When a new order comes in, the shipment tracking is empty. I guess this is because the mail is sent too fast. I think this because of the reason, that when I send the processing mail from the admin backend manually, then I have all info. So the code is fully working. I only have the problem with the automatically sent mail from WooCommerce when a new order comes in.

I found this but there is no time delay: Send an Email notification to the admin for pending order status in WooCommerce

Also, I found this plugin code on Github from Damien Carbery. But I don't know if I can just copy the code and make changes to it?

This is the part that I should change maybe:

'woocommerce_order_status_pending_to_processing' => array( 'WC_Email_New_Order', $this->default_defer_time ),
LoicTheAztec
  • 207,510
  • 22
  • 296
  • 340
Nik7
  • 384
  • 1
  • 11
  • 1
    Sorry, I use OOTB for Out-of-the-box :) – Nik7 Feb 11 '21 at 15:40
  • @LoicTheAztec I check the code from link two again. Do I really have to sue this full code? Is there a simple solution? – Nik7 Feb 12 '21 at 11:59
  • 1
    Why you don't use the plugin: copy the code to a txt file and save it as `wc-defer-order-emails.php` … add the file in a folder that you can name for example `woocommerce-defer-order-emails`. Zip the folder and upload it as a plugin in Wordpress > plugins dashboard… – LoicTheAztec Feb 12 '21 at 12:21
  • I did that already, But there is no setting page. And I do not 100% understand which code lines I have to chnage – Nik7 Feb 12 '21 at 15:51
  • 1
    I will have a look to the plugin code (I just clone it as a Gist in github). – LoicTheAztec Feb 12 '21 at 16:10
  • @LoicTheAztec I tried to adjust the plugin code and uncomment the line'woocommerce_order_status_pending_to_processing' => array( 'WC_Email_New_Order', $this->default_defer_time ), and comment the other lines. In my understanding this should only the work for order processing mail. But It does not work. No error or so.. I guess something is wrong with my code here. Can you maybe share the link to your github? – Nik7 Feb 18 '21 at 16:28

0 Answers0