[wp-trac] [WordPress Trac] #38028: Send emails via an action
WordPress Trac
noreply at wordpress.org
Wed Aug 6 16:49:55 UTC 2025
#38028: Send emails via an action
--------------------------------+------------------------------
Reporter: markcallen | Owner: (none)
Type: enhancement | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version:
Severity: normal | Resolution: wontfix
Keywords: dev-feedback close | Focuses:
--------------------------------+------------------------------
Changes (by SirLouen):
* status: new => closed
* resolution: => wontfix
Comment:
Replying to [comment:7 markcallen]:
> That's fine, I'd given up on anything ever happening with this anyway.
>
> I maintain that all notifications/emails should be triggered by an
action - with subsequent calls to `wp_mail()`, so they can be controlled
by developers - either through replacement emails, or setting up other
channels (WhatsApp, SMS, RCS... whatever), along with leaving `wp_mail()`
intact for fallback (and backward compatibility where existing plugins
have replaced it).
>
> I think it's a very simple implementation and would not take huge
effort, but understand there may be broader considerations I'm not aware
of.
The whole system has moved into a filter for “full control”
(enable/disable and editing subject/bodies).
> wp_mail stays in tact and as the hook call replaces current
functionality there is no issue with backward compatibility - all existing
filters can stay in place.
This proposal maybe was good back in the past, but nowadays it it's
massively redundant to the filters. Yes, actions won't get in the way, but
as I say, they are simply redundant. Nowadays you cannot do anything with
actions that you cannot do with filters (plus multipart is not even
supported yet, still in progress). And since filters are not going to go
anywhere soon (and even less with a major revamp with actions), I believe
that this report has stallen to death.
> Use a different server to send (e.g. to benefit from DKIM/SPF)
Possibly I'm missing some context from 9 years ago when this was
published, but with `phpmailer_init` action this is easily manageable.
Looking forward to a more future-proof strategy, the new proposal which
aligns better with current standards, is the idea of building up a
templating system that could allow fully upgrading to multipart (with all
the major improvements associated, like the ability to control for
example, RTL emails). Still, `wp_mail` is pluggable and still, it feels
more like a fallback (for those who have not decided to add a plugin to
fully override its functionality) than a standalone internal feature.
There are some related issues to this topic like:
#49661
#51717
#15448
Since this is not going to take us anywhere, I think it's time to conclude
this as a closure with `wontfix` or `maybelater`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38028#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list