Make WordPress Core

Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#42132 closed enhancement (fixed)

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

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Users Keywords: good-first-bug has-patch needs-refresh dev-feedback has-dev-note
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 (4)

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

Download all attachments as: .zip

Change History (25)

#1 @contact-banker
7 years ago

Added patch for #42132.

It now applies filter to the contents of the email.

#2 @contact-banker
7 years ago

  • Keywords has-patch added; needs-patch removed

@anand.au14
7 years ago

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

#3 @johnbillion
7 years ago

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

#4 @johnbillion
7 years ago

  • Milestone changed from Future Release to 5.0

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


7 years ago

#6 @benoitchantre
6 years ago

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

#7 follow-up: @anand.au14
6 years 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
6 years 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
6 years ago

  • Keywords needs-unit-tests dev-feedback added

@nikolam
6 years ago

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

#10 @nikolam
6 years ago

  • Keywords needs-unit-tests removed

No need for unit tests for this change IMO.

#11 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1

#12 @pento
6 years ago

  • Milestone changed from 5.1 to 5.2

#13 @desrosj
5 years ago

  • Milestone changed from 5.2 to 5.3

This ticket has not received any attention during the 5.2 cycle. With beta
1 tomorrow, going to punt this to 5.3.

This ticket was mentioned in Slack in #core by sergey. View the logs.


5 years ago

#15 @desrosj
5 years ago

  • Keywords needs-refresh added
  • Milestone changed from 5.3 to Future Release

The patch is no longer applying cleanly and still needs review. The 5.3 beta deadline is just under 4 days away, so I am going to punt this.

If the patch is refreshed and someone has time to review before that, it can be moved back.

@anand.au14
5 years ago

Added refreshed patch

This ticket was mentioned in Slack in #core by anandau14. View the logs.


5 years ago

#18 @johnbillion
4 years ago

  • Milestone changed from Future Release to 5.6

#19 @johnbillion
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49029:

Users: Introduce the invited_user_email filter for filtering the contents of the email sent when an existing user is invited to a site on Multisite.

Props contact-banker, anand.au14, nikolam, johnbillion

Fixes #42132

#20 @desrosj
4 years ago

  • Keywords needs-dev-note added

Let's note this new filter in the miscellaneous dev note.

Note: See TracTickets for help on using tickets.