wc-smooth-generator icon indicating copy to clipboard operation
wc-smooth-generator copied to clipboard

Don't send any emails during item generation

Open coreymckrill opened this issue 1 year ago • 2 comments

The Customer generator has a method to disable emails while generating new customers/users. However, other emails can still be sent when generating products (e.g. low stock) and also potentially orders. We should probably abstract the method from the Customers class and apply it every time any generator is running.

coreymckrill avatar Jul 13 '24 00:07 coreymckrill

However, other emails can still be sent when generating products (e.g. low stock) and also potentially orders.

Transactional emails were disabled in #58. You could add any additional email hooks to that list.

rrennick avatar Jul 15 '24 17:07 rrennick

Just wanted to add on here that I was testing with a clean Jurassic Ninja site, generating orders from the wp-admin screen.

That was still triggering an email to the admin about each new order created. I'm not quite sure what hook that would be to add as it seems the order status changes is already being excluded.

However I did notice that if woocommerce_defer_transactional_emails is enabled we should be unhooking queue_transactional_email instead of send_transactional_email, or alternatively just disable woocommerce_allow_send_queued_transactional_email.

mikkamp avatar Aug 16 '24 11:08 mikkamp