Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send any emails during item generation #140

Open
coreymckrill opened this issue Jul 13, 2024 · 2 comments · May be fixed by #157
Open

Don't send any emails during item generation #140

coreymckrill opened this issue Jul 13, 2024 · 2 comments · May be fixed by #157

Comments

@coreymckrill
Copy link
Contributor

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.

@rrennick
Copy link
Contributor

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.

@mikkamp
Copy link
Contributor

mikkamp commented Aug 16, 2024

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.

coreymckrill added a commit that referenced this issue Jan 3, 2025
This consolidates the steps that each generator class needs to take
before generating objects into one `initialize` method. These steps
include creating an instance of the Faker library and unhooking all the
callbacks that send transactional emails. This ensures that the emails
are disabled regardless of which entrypoint to Smooth Generator is used
(cli or web UI).

Fixes #140
@coreymckrill coreymckrill linked a pull request Jan 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants