Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#44235 closed enhancement (wontfix)

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

Reported by: garrett-eclipse's profile garrett-eclipse Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: Privacy Keywords:
Focuses: administration Cc:

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
7 years 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
7 years 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
7 years 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
7 years 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.


7 years ago

#6 @Clorith
7 years ago

  • Milestone Awaiting Review deleted

#7 @Clorith
7 years ago

#44376 was marked as a duplicate.

#8 @garrett-eclipse
7 years ago

#44376 was marked as a duplicate.

Note: See TracTickets for help on using tickets.