Privacy: add user request type to the admin notification email subject.

Merges [43375] to the 4.9 branch.
Props birgire, desrosj.
Fixes #44099.
Built from https://develop.svn.wordpress.org/branches/4.9@43450


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-07-16 12:09:26 +00:00
parent 9ad59101ab
commit 8f33283493
2 changed files with 34 additions and 9 deletions

View File

@ -2895,13 +2895,8 @@ function _wp_privacy_send_request_confirmation_notification( $request_id ) {
return;
}
$subject = sprintf(
/* translators: %s Site name. */
__( '[%s] Action Confirmed' ),
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
);
$manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
$manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
$action_description = wp_user_request_action_description( $request_data->action_name );
/**
* Filters the recipient of the data request confirmation notification.
@ -2922,7 +2917,7 @@ function _wp_privacy_send_request_confirmation_notification( $request_id ) {
$email_data = array(
'request' => $request_data,
'user_email' => $request_data->email,
'description' => wp_user_request_action_description( $request_data->action_name ),
'description' => $action_description,
'manage_url' => $manage_url,
'sitename' => get_option( 'blogname' ),
'siteurl' => home_url(),
@ -2981,6 +2976,36 @@ All at ###SITENAME###
$content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$subject = sprintf(
/* translators: 1: Site name. 2: Name of the confirmed action. */
__( '[%1$s] Action Confirmed: %2$s' ),
$blogname,
$action_description
);
/**
* Filters the subject of the user request confirmation email.
*
* @since 4.9.7
*
* @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 $user_email The email address confirming a request
* @type string $description Description of the action being performed so the user knows what the email is for.
* @type string $manage_url The link to click manage privacy requests of this type.
* @type string $sitename The site name sending the mail.
* @type string $siteurl The site URL sending the mail.
* @type string $admin_email The administrator email receiving the mail.
* }
*/
$subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $blogname, $email_data );
$email_sent = wp_mail( $email_data['admin_email'], $subject, $content );
if ( $email_sent ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9.8-alpha-43449';
$wp_version = '4.9.8-alpha-43450';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.