Index: src/wp-includes/user.php =================================================================== --- src/wp-includes/user.php (revision 45254) +++ src/wp-includes/user.php (working copy) @@ -3061,6 +3061,8 @@ * ###MANAGE_URL### The URL to manage requests. * ###SITEURL### The URL to the site. * + * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead. + * * @since 4.9.6 * * @param string $email_text Text in the email. @@ -3197,7 +3199,7 @@ if ( empty( $email_data['privacy_policy_url'] ) ) { /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ - $email_text = __( + $content = __( 'Howdy, Your request to erase your personal data on ###SITENAME### has been completed. @@ -3210,7 +3212,7 @@ ); } else { /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */ - $email_text = __( + $content = __( 'Howdy, Your request to erase your personal data on ###SITENAME### has been completed. @@ -3233,13 +3235,17 @@ * * The following strings have a special meaning and will get replaced dynamically: * + * Use the {@see 'user_erasure_fulfillment_email_content'} filter instead. + * * ###SITENAME### The name of the site. * ###PRIVACY_POLICY_URL### Privacy policy page URL. * ###SITEURL### The URL to the site. * * @since 4.9.6 + * @deprecated 5.3.0 Use {@see 'user_erasure_fulfillment_email_content'} filter instead. + * @ignore This duplicate is deprecated and ignored to avoid documentation issues. * - * @param string $email_text Text in the email. + * @param string $content The email content. * @param array $email_data { * Data relating to the account action email. * @@ -3252,8 +3258,37 @@ * @type string $siteurl The site URL sending the mail. * } */ - $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); + $content = apply_filters_deprecated( 'user_confirmed_action_email_content', array( $content, $email_data ), '5.3.0', 'user_erasure_fulfillment_email_content' ); + /** + * Filters the body of the data erasure fulfillment notification. + * + * The email is sent to a user when a their data erasure request is fulfilled + * by an administrator. + * + * The following strings have a special meaning and will get replaced dynamically: + * + * ###SITENAME### The name of the site. + * ###PRIVACY_POLICY_URL### Privacy policy page URL. + * ###SITEURL### The URL to the site. + * + * @since 5.3.0 + * + * @param string $content The email content. + * @param array $email_data { + * Data relating to the account action email. + * + * @type WP_User_Request $request User request object. + * @type string $message_recipient The address that the email will be sent to. Defaults + * to the value of `$request->email`, but can be changed + * by the `user_erasure_fulfillment_email_to` filter. + * @type string $privacy_policy_url Privacy policy URL. + * @type string $sitename The site name sending the mail. + * @type string $siteurl The site URL sending the mail. + * } + */ + $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data ); + $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); Index: tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php =================================================================== --- tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php (revision 45254) +++ tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php (working copy) @@ -236,7 +236,7 @@ * @ticket 44234 */ public function test_email_body_text_should_be_filterable() { - add_filter( 'user_confirmed_action_email_content', array( $this, 'filter_email_body_text' ) ); + add_filter( 'user_erasure_fulfillment_email_content', array( $this, 'filter_email_body_text' ) ); _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); $mailer = tests_retrieve_phpmailer_instance();