Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44382 closed defect (bug) (fixed)

Filter the subject within _wp_privacy_send_request_confirmation_notification

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: azaozz's profile azaozz
Milestone: 4.9.8 Priority: normal
Severity: normal Version: 4.9.6
Component: Privacy Keywords: has-patch commit fixed-major
Focuses: Cc:



Looks like a filter was missed for the $subject found within _wp_privacy_send_request_confirmation_notification(). It should match the filter found in wp_send_user_request

Reference -

	 * Filters the subject of the email sent when an account action is attempted.
	 * @since 4.9.6
	 * @param string $subject    The email subject.
	 * @param string $blogname   The name of the site.
	 * @param array  $email_data {
	 *     Data relating to the account action email.
	 *     @type WP_User_Request $request     User request object.
	 *     @type string          $email       The email address this is being sent to.
	 *     @type string          $description Description of the action being performed so the user knows what the email is for.
	 *     @type string          $confirm_url The link to click on to confirm the account action.
	 *     @type string          $sitename    The site name sending the mail.
	 *     @type string          $siteurl     The site URL sending the mail.
	 * }
	$subject = apply_filters( 'user_request_action_email_subject', $subject, $blogname, $email_data );


Attachments (2)

44382.diff (2.0 KB) - added by birgire 6 years ago.
44382.2.diff (2.4 KB) - added by desrosj 6 years ago.

Download all attachments as: .zip

Change History (14)

#1 @garrett-eclipse
6 years ago

  • Component changed from General to Privacy
  • Focuses privacy added
  • Version set to trunk

6 years ago

#2 @birgire
6 years ago

Yes, it looks like it's missing.

44382.diff is a suggestion that adds the filter user_request_confirmed_email_subject for the subject of the user request confirmation email.

It also moves the $subject assigning down, to have it near the new filter, similar to wp_send_user_request(). It looks save to me. I will though most likely revert this to keep the patch as simple as possible. Just wanted to get some opinion on this ;-)

@garrett-eclipse What do you think about that?

PS: A related ticket is #44265, that adds an email subject filter within _wp_privacy_send_erasure_fulfillment_notification()

#3 @garrett-eclipse
6 years ago

Thanks @birgire I like it and did notice the difference in placement good catch there.

6 years ago

#4 @desrosj
6 years ago

  • Focuses privacy removed
  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.9.7
  • Version changed from trunk to 4.9.6

This looks good to me. In 44382.2.diff I added documentation for $admin_email in the $email_data array for the new filter. This was also missing from the user_confirmed_action_email_content filter directly above.

One thing I noticed looking at this is an inconsistent use of blogname and sitename in these emails. I am going to open a new ticket for this though.

@garrett-eclipse for future reference, the Version field in Trac should be the earliest affected version of WordPress (4.9.6 in this instance), and you don't have to assign the privacy focus if the component is also Privacy. Thanks for all the great tickets!

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.

6 years ago

#6 @garrett-eclipse
6 years ago

Thanks @desrosj appreciate the tip. And that patch looks pretty here, thanks

#7 @azaozz
6 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 43373:

Privacy: filter the email subject in _wp_privacy_send_request_confirmation_notification().

Props garrett-eclipse, birgire, desrosj.
Fixes #44382.

#8 @azaozz
6 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen for 4.9.7.

#9 @ocean90
6 years ago

  • Milestone changed from 4.9.7 to 4.9.8

4.9.7 has been released, moving to next milestone.

#10 @SergeyBiryukov
6 years ago

In 43451:

Privacy: Change @since entry for user_request_confirmed_email_subject filter added in [43373] to 4.9.8.

See #44382.

#11 @SergeyBiryukov
6 years ago

[43373] was accidentally backported with [43375] in [43450], I guess it's fine to leave that as is.

#12 @SergeyBiryukov
6 years ago

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

In 43452:

Privacy: Change @since entry for user_request_confirmed_email_subject filter added in [43373] to 4.9.8.

Merges [43451] to the 4.9 branch.
Fixes #44382.

Note: See TracTickets for help on using tickets.