WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#29673 closed enhancement (duplicate)

Refactor wp_mail() So Plugging Functions Copy Less

Reported by: BFTrick Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:

Description

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. :)

Change History (1)

#1 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #29513.

Note: See TracTickets for help on using tickets.