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

Ensure WC emails are disabled before generating #157

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

coreymckrill
Copy link
Contributor

@coreymckrill coreymckrill commented Jan 3, 2025

Changes proposed in this Pull Request:

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

How to test the changes in this Pull Request:

  1. Install an email catcher plugin like WP Mail Logging so you can see the outgoing emails from your test site.
  2. Replicate the issue on trunk first: try generating some products and/or orders, particularly using the web UI rather than wp-cli (WP Admin > Tools > Smooth Generator). Note that emails have been sent about low/no stock when generating some orders, and that emails have been sent about order statuses when generating orders.
  3. Now check out this branch and try again. This time there shouldn't be any emails sent.
  4. Also try generating things from wp-cli to make sure there aren't any regressions.

Changelog entry

Ensure transactional emails are disabled before generating test content.

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 self-assigned this Jan 3, 2025
@coreymckrill coreymckrill marked this pull request as ready for review January 3, 2025 22:31
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 this pull request may close these issues.

Don't send any emails during item generation
1 participant