Ticket #44314: 44314.3.diff
File 44314.3.diff, 4.5 KB (added by , 5 years ago) |
---|
-
src/wp-includes/user.php
3061 3061 * ###MANAGE_URL### The URL to manage requests. 3062 3062 * ###SITEURL### The URL to the site. 3063 3063 * 3064 * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3065 * 3064 3066 * @since 4.9.6 3065 3067 * 3066 3068 * @param string $email_text Text in the email. … … 3197 3199 3198 3200 if ( empty( $email_data['privacy_policy_url'] ) ) { 3199 3201 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3200 $ email_text = __(3202 $content = __( 3201 3203 'Howdy, 3202 3204 3203 3205 Your request to erase your personal data on ###SITENAME### has been completed. … … 3210 3212 ); 3211 3213 } else { 3212 3214 /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */ 3213 $ email_text = __(3215 $content = __( 3214 3216 'Howdy, 3215 3217 3216 3218 Your request to erase your personal data on ###SITENAME### has been completed. … … 3233 3235 * 3234 3236 * The following strings have a special meaning and will get replaced dynamically: 3235 3237 * 3238 * Use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3239 * 3236 3240 * ###SITENAME### The name of the site. 3237 3241 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3238 3242 * ###SITEURL### The URL to the site. 3239 3243 * 3240 3244 * @since 4.9.6 3245 * @deprecated 5.3.0 Use {@see 'user_erasure_fulfillment_email_content'} filter instead. 3246 * @ignore This duplicate is deprecated and ignored to avoid documentation issues. 3241 3247 * 3242 * @param string $ email_text Text in the email.3248 * @param string $content The email content. 3243 3249 * @param array $email_data { 3244 3250 * Data relating to the account action email. 3245 3251 * … … 3252 3258 * @type string $siteurl The site URL sending the mail. 3253 3259 * } 3254 3260 */ 3255 $content = apply_filters ( 'user_confirmed_action_email_content', $email_text, $email_data);3261 $content = apply_filters_deprecated( 'user_confirmed_action_email_content', array( $content, $email_data ), '5.3.0', 'user_erasure_fulfillment_email_content' ); 3256 3262 3263 /** 3264 * Filters the body of the data erasure fulfillment notification. 3265 * 3266 * The email is sent to a user when a their data erasure request is fulfilled 3267 * by an administrator. 3268 * 3269 * The following strings have a special meaning and will get replaced dynamically: 3270 * 3271 * ###SITENAME### The name of the site. 3272 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3273 * ###SITEURL### The URL to the site. 3274 * 3275 * @since 5.3.0 3276 * 3277 * @param string $content The email content. 3278 * @param array $email_data { 3279 * Data relating to the account action email. 3280 * 3281 * @type WP_User_Request $request User request object. 3282 * @type string $message_recipient The address that the email will be sent to. Defaults 3283 * to the value of `$request->email`, but can be changed 3284 * by the `user_erasure_fulfillment_email_to` filter. 3285 * @type string $privacy_policy_url Privacy policy URL. 3286 * @type string $sitename The site name sending the mail. 3287 * @type string $siteurl The site URL sending the mail. 3288 * } 3289 */ 3290 $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data ); 3291 3257 3292 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3258 3293 $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); 3259 3294 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); -
tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
236 236 * @ticket 44234 237 237 */ 238 238 public function test_email_body_text_should_be_filterable() { 239 add_filter( 'user_ confirmed_action_email_content', array( $this, 'filter_email_body_text' ) );239 add_filter( 'user_erasure_fulfillment_email_content', array( $this, 'filter_email_body_text' ) ); 240 240 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 241 241 242 242 $mailer = tests_retrieve_phpmailer_instance();