Opened 3 years ago
Last modified 13 months ago
#53829 new enhancement
Add unique keywords for wp_mail calls to categorize it
Reported by: | birgire | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Keywords: | ||
Focuses: | Cc: |
Description
Here's a suggestion to add unique keywords (handles) for wp_mail()
calls to better categorize it, like: namespace:component/to/subject
, if we simulate the block names structure, just to mention one possibility.
Examples: wp:login/user/retrieve_password
or wp:login/site_admin/new_user
where wp
is the namespace for WordPress core and plugins could use their own.
These might also be in separate array arguments, instead of a single string.
This would help targeting a single email or group of emails.
It might be easier to implement if wp_mail()
would support a single array of arguments: wp_mail( $args )
ps: Helpful list of core emails:
Change History (3)
#2
@
3 years ago
Thanks for your feedback @TimothyBlynJacobs, yes I've been trying to find a way to categorize emails for a little email traffic plugin and found this to be missing :-)
ps: On a similar note, instead of using a pre_wp_mail
hook trick to get the success/failure output of wp_mail
I've also suggested an new succeeded mail action here: #53826 that might help email loggers.
I agree this would be a very helpful feature for better logging and could also provide additional utility to the existing filters in
wp_mail()
.