Make WordPress Core

Opened 10 years ago

Closed 6 years ago

#15594 closed enhancement (invalid)

make pluggable the multisite/"wpmu" mails

Reported by: arena Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.1
Component: Mail Keywords:
Focuses: multisite Cc:


such as the one that is generated in the first lines of


Attachments (1)

wp_mail.txt (2.3 KB) - added by arena 9 years ago.
wp_mail use in wordpress nightly build

Download all attachments as: .zip

Change History (13)

#1 @nacin
9 years ago

  • Keywords 2nd-opinion added
  • Type changed from task (blessed) to feature request

#2 @SergeyBiryukov
9 years ago

There's a filter already, isn't it sufficient? Are there any emails without a filter?

#3 @arena
9 years ago

in wordpress before merging with wpmu,

wp_mail function and mails are all pluggable

in wpmu that is not the case.
I think all wpmu mails should be pluggable !

#4 @westi
9 years ago

What specific functions do you want to see as pluggable.

This ticket is lacking in detail :-(

9 years ago

wp_mail use in wordpress nightly build

#5 @arena
9 years ago

see wp_mail file attached from wordpress latest nightly build to show you that

For a mono site install, all mails are issued from wp-includes/pluggable.php except for

  • wp-login.php:233 where there is a filter : 'retrieve_password_message' that allows you to completly override the wp_mail function.
  • wp-mail.php:184: for posting posts via mails

For a multi site install none of the mails send are pluggable. Filtering the content is not enough when you want to send multipart mails (html & plaintext see MailPress plugin).
All the ms mails should be pluggable or at least have a specific filter such as in wp-login.php:233

hope this makes it clear !


#6 @dd32
9 years ago

If i was to replace every mention of "pluggable" with "Filterable" (ie. apply_filters(..)), would that be correct arena?

Basically, not all MU-generated emails filter the content through specific filters?

Now, Before the merge, I'm assuming wpmu -didn't- filter them either?

In the meantime, you can use the generic wp_mail filter, and switch based on the passed content/subject.

#7 @westi
9 years ago

Also possibly rather than a filter it should be an action that the default email sending function is hooked onto.

#8 @arena
9 years ago

If i was to replace every mention of "pluggable" with "Filterable" (ie. apply_filters(..)), would that be correct arena?

Looks good to me like this is done with filter 'retrieve_password_message' in wp-login.php

	$message = apply_filters('retrieve_password_message', $message, $key);

	if ( $message && !wp_mail($user_email, $title, $message) )
		wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );

#9 @nacin
9 years ago

  • Keywords multisite needs-patch added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from feature request to enhancement

#10 @chriscct7
6 years ago

It seems all the emails have (and have had) filters for the content since the merge with WPMU. Am I misinterpreting something here?

This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.

6 years ago

#12 @DrewAPicture
6 years ago

  • Keywords needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

It appears there may yet be at least one Multisite email contents that isn't filterable. I talked to @jeremyfelt and the consensus is to close this ticket and open new ones for individual emails as they're identified.

Note: See TracTickets for help on using tickets.