Miller-Media / send-emails-with-mandrill

A fork of the official wpMandrill plugin for Wordpress, since it is no longer being actively supported.
21 stars 15 forks source link

`woocommerce_email` probably not best hook #84

Open crstauf opened 3 years ago

crstauf commented 3 years ago

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:

crstauf commented 3 years ago

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 commented 3 years ago

@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 commented 2 years ago

@MillerMedia ☝️