-
Notifications
You must be signed in to change notification settings - Fork 16
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
wp_mail_from* filters are ignored #48
Comments
Hi @markdwhite, That is correct - as of right now wp_mail_from and wp_mail_from_name would be ignored with the wp_mail override we do. I can't speak to why that decision was made, as I wasn't involved in the project at the time. I am hesitant to modify this behavior in case it has some unintended side effects for long time users of the plugin. Would something like this be what is required to support using those filters with the Postmark for WordPress plugin? |
I totally understand about the need to maintain backwards compatibility. So it probably depends what order of precedence is best for correctly identifying $from. The example code seems to be allowing the substitution of either/or wp_mail_from and wp_mail_from_name which requires the deconstruction of $from from the header. It might be reasonable to assume that the existence of a wp_mail_from allows for inclusion of wp_mail_from_name, otherwise $from from the header is used and wp_mail_from_name is discarded. So all that might be needed is:
And am I right in thinking that Postmark API will swap in the correct sender name from a Sender Signature if the sender email matches a signature? If so, we gain nothing by prepending the $from_name as it will be overwritten. I think I tested it this way, but could be wrong... |
It looks like only the From headers are used to override whatever is set in postmark_settings, and that wp_mail_from and wp_mail_from_name are ignored. Is this correct?
This would suggest that we need to append to a From header in some way when we are using Postmark with a plugin that adds filters for wp_mail_from and from_name.
Does this sound about right?
The text was updated successfully, but these errors were encountered: