[wp-trac] [WordPress Trac] #29673: Refactor wp_mail() So Plugging Functions Copy Less
WordPress Trac
noreply at wordpress.org
Sun Sep 14 21:42:06 UTC 2014
#29673: Refactor wp_mail() So Plugging Functions Copy Less
-------------------------+-----------------------------
Reporter: BFTrick | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
`wp_mail` is kind of a beast. I noticed various plugins having to copy all
250+ lines if they just want to change one small thing. It would be better
to have smaller helper functions that do some of this logic. Plugging
functions would have to duplicate less code which is
[DRY](http://en.wikipedia.org/wiki/Don't_repeat_yourself).
We could cut out 75 lines by abstracting `get_mail_headers()`, more lines
with `get_mail_from_name()`, and yet more with `get_mail_recipients()`.
It would be great to abstract some of this functionality so plugging
functions have less they can mess up. And less to update in case the
functionality every changes.
If someone gives the go-ahead I'd love to submit the patch myself. :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29673>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list