Opened 3 years ago
Last modified 2 years ago
#15594 new enhancement
make pluggable the multisite/"wpmu" mails
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Version: | 3.1 | |
| Severity: | minor | Keywords: | multisite needs-patch |
| Cc: |
Description
such as the one that is generated in the first lines of
wp-admin/user-new.php
Attachments (1)
Change History (10)
comment:1
nacin
— 3 years ago
- Keywords 2nd-opinion added
- Type changed from task (blessed) to feature request
comment:2
SergeyBiryukov
— 3 years ago
comment:3
arena
— 2 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 !
comment:4
westi
— 2 years ago
What specific functions do you want to see as pluggable.
This ticket is lacking in detail :-(
comment:5
arena
— 2 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 !
Thanks
comment:6
dd32
— 2 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.
comment:7
westi
— 2 years ago
Also possibly rather than a filter it should be an action that the default email sending function is hooked onto.
comment:8
arena
— 2 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...') );
There's a filter already, isn't it sufficient? Are there any emails without a filter?