WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 5 weeks ago

#42132 reviewing enhancement

Add filter to emails sent by wp-admin/user-new.php

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Users Keywords: good-first-bug has-patch dev-feedback
Focuses: multisite Cc:

Description

wp-admin/user-new.php contains a call to wp_mail() which sends an email when an existing user is invited to a site from the Users -> Add New -> Add Existing User screen within a site on Multisite. (Ref).

The contents of the email cannot be filtered. The subject, message, and headers should be passed through a filter in the same format as the password_change_email filter. (Ref).

Attachments (3)

42132.patch (1.9 KB) - added by contact-banker 9 months ago.
42132.2.patch (2.3 KB) - added by anand.au14 9 months ago.
Added patch to add filter content of email sent on new user joining confirmation
42132.3.diff (6.2 KB) - added by nikolam 5 weeks ago.
Refreshed the patch. Cleared up the code a bit, made it to look more like #42133

Download all attachments as: .zip

Change History (13)

#1 @contact-banker
9 months ago

Added patch for #42132.

It now applies filter to the contents of the email.

#2 @contact-banker
9 months ago

  • Keywords has-patch added; needs-patch removed

@anand.au14
9 months ago

Added patch to add filter content of email sent on new user joining confirmation

#3 @johnbillion
9 months ago

  • Owner set to johnbillion
  • Status changed from new to reviewing

#4 @johnbillion
9 months ago

  • Milestone changed from Future Release to 5.0

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


8 months ago

#6 @benoitchantre
3 months ago

It would be great to add a filter for $new_user_email['subject'].

#7 follow-up: @anand.au14
8 weeks ago

@benoitchantre Proposed patches have a filter for the array - $new_user_mail which includes To (recipient email), Subject and Message. So it will also allow filtering the subject.

#8 in reply to: ↑ 7 @benoitchantre
8 weeks ago

Replying to anand.au14:

@benoitchantre Proposed patches have a filter for the array - $new_user_mail which includes To (recipient email), Subject and Message. So it will also allow filtering the subject.

Great, thank you for mentioning that @anand.au14. I didn't saw it :-)

#9 @abdullahramzan
5 weeks ago

  • Keywords needs-unit-tests dev-feedback added

@nikolam
5 weeks ago

Refreshed the patch. Cleared up the code a bit, made it to look more like #42133

#10 @nikolam
5 weeks ago

  • Keywords needs-unit-tests removed

No need for unit tests for this change IMO.

Note: See TracTickets for help on using tickets.