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

woocommerce_email probably not best hook #84

Open
crstauf opened this issue Aug 27, 2021 · 3 comments
Open

woocommerce_email probably not best hook #84

crstauf opened this issue Aug 27, 2021 · 3 comments

Comments

@crstauf
Copy link
Contributor

crstauf commented Aug 27, 2021

In my investigation of #82 and submission of #83 I realized that woocommerce_email hook is loaded on every page, frontend (guest and user) and backend. For sites that have "Fix for WooCommerce emails" enabled (after #83 is merged), that the setting will be applied to all emails.

I'm working on identifying a better hook right now, but this is a problem that should hold #83 until it's resolved.

It is preferable that the action in use:

  • is only called when a WooCommerce email is about to be sent
  • is an actual action, and not a filter
  • is guaranteed to run regardless of customization or source
@crstauf
Copy link
Contributor Author

crstauf commented Aug 27, 2021

From the research I've done so far, there's not really a great action to work with: most of the actions are used to customize the template, and are not guaranteed to be on all emails.

@crstauf
Copy link
Contributor Author

crstauf commented Aug 27, 2021

@MillerMedia Instead of attempting to identify emails from WooCommerce, is it acceptable to adjust the setting to be more generic to HTML emails, and functionally look for Content-Type: text/html in the email headers?

@crstauf
Copy link
Contributor Author

crstauf commented Jul 14, 2022

@MillerMedia ☝️

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

No branches or pull requests

1 participant