WordPress.org

Make WordPress Core

Opened 19 months ago

Closed 19 months ago

Last modified 18 months ago

#44235 closed enhancement (wontfix)

GDPR - Provide filter on $email_data for the confirmed action emails

Reported by: garrett-eclipse Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: Privacy Keywords:
Focuses: administration Cc:
PR Number:

Description

Hello,

I was wondering if along with the user_confirmed_action_email_content filter for $email_text > $content should there also be a filter for the $email_data so plugins/devs can customize the array (request, user_email, description, manage_url, sitename, siteurl, admin_email) as this information is all used after the user_confirmed_action_email_content filter to update the $content so there’s not currently a method to customize this data before it's use.

The $email_data array I'm referring to;
https://github.com/WordPress/WordPress/blob/3ee58b55b14683af4c568bce1845c37408c88fbb/wp-includes/user.php#L3000

Cheers

Change History (8)

#1 @soulseekah
19 months ago

Hey Garret,

Thanks for bringing up this issue.

It appears that the user_confirmed_action_email_content filter can be used to alter the content of the e-mail to any extent. The e-mail data doesn't really need to be filtered for this.

Thoughts?

#2 @garrett-eclipse
19 months ago

Thanks @soulseekah, should the filter be moved after all the str_replaces though so it's able to act on the completed email as you can't modify say the description as easily as it doesn't get included int he $content until after the filter. Cheers

#3 @soulseekah
19 months ago

Moving the filter further down would provide the content without the ###PLACEHOLDER### text. So for example, if you want to change the wording for the description, you would filter by:

add_filter( 'user_confirmed_action_email_content', function( $content, $data ) {
    return str_replace( '###DESCRIPTION###', 'The new description', $content );
}, 10, 2 );

Much easier than trying to work with the rendered text.

#4 @garrett-eclipse
19 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

Ahh good point @soulseekah thanks for that. Resolving as a wontfix

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


18 months ago

#6 @Clorith
18 months ago

  • Milestone Awaiting Review deleted

#7 @Clorith
18 months ago

#44376 was marked as a duplicate.

#8 @garrett-eclipse
18 months ago

#44376 was marked as a duplicate.

Note: See TracTickets for help on using tickets.