Changeset 51129
- Timestamp:
- 06/09/2021 01:34:09 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/privacy-tools.php
r50713 r51129 663 663 /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */ 664 664 $email_text = __( 665 'Howdy, 665 // phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent 666 'Howdy, 666 667 667 668 Your request for an export of personal data has been completed. You may -
trunk/src/wp-includes/user.php
r51126 r51129 3647 3647 ); 3648 3648 3649 /* translators: Do not translate SITENAME, USER_EMAIL, DESCRIPTION, MANAGE_URL, SITEURL; those are placeholders. */ 3650 $email_text = __( 3651 'Howdy, 3652 3653 A user data privacy request has been confirmed on ###SITENAME###: 3654 3655 User: ###USER_EMAIL### 3656 Request: ###DESCRIPTION### 3657 3658 You can view and manage these data privacy requests here: 3659 3660 ###MANAGE_URL### 3661 3662 Regards, 3663 All at ###SITENAME### 3664 ###SITEURL###' 3649 $subject = sprintf( 3650 /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */ 3651 __( '[%1$s] Action Confirmed: %2$s' ), 3652 $email_data['sitename'], 3653 $action_description 3665 3654 ); 3666 3655 3667 3656 /** 3668 * Filters the body of the user request confirmation email. 3669 * 3670 * The email is sent to an administrator when an user request is confirmed. 3671 * The following strings have a special meaning and will get replaced dynamically: 3672 * 3673 * ###SITENAME### The name of the site. 3674 * ###USER_EMAIL### The user email for the request. 3675 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. 3676 * ###MANAGE_URL### The URL to manage requests. 3677 * ###SITEURL### The URL to the site. 3678 * 3679 * @since 4.9.6 3680 * 3681 * @param string $email_text Text in the email. 3657 * Filters the subject of the user request confirmation email. 3658 * 3659 * @since 4.9.8 3660 * 3661 * @param string $subject The email subject. 3662 * @param string $sitename The name of the site. 3682 3663 * @param array $email_data { 3683 3664 * Data relating to the account action email. … … 3692 3673 * } 3693 3674 */ 3694 $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); 3695 3696 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3697 $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content ); 3698 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 3699 $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content ); 3700 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3701 3702 $subject = sprintf( 3703 /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */ 3704 __( '[%1$s] Action Confirmed: %2$s' ), 3705 $email_data['sitename'], 3706 $action_description 3675 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data ); 3676 3677 /* translators: Do not translate SITENAME, USER_EMAIL, DESCRIPTION, MANAGE_URL, SITEURL; those are placeholders. */ 3678 $content = __( 3679 // phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent 3680 'Howdy, 3681 3682 A user data privacy request has been confirmed on ###SITENAME###: 3683 3684 User: ###USER_EMAIL### 3685 Request: ###DESCRIPTION### 3686 3687 You can view and manage these data privacy requests here: 3688 3689 ###MANAGE_URL### 3690 3691 Regards, 3692 All at ###SITENAME### 3693 ###SITEURL###' 3707 3694 ); 3708 3695 3709 3696 /** 3710 * Filters the subject of the user request confirmation email. 3711 * 3712 * @since 4.9.8 3713 * 3714 * @param string $subject The email subject. 3715 * @param string $sitename The name of the site. 3697 * Filters the body of the user request confirmation email. 3698 * 3699 * Use {@see 'user_request_confirmed_email_content'} instead. 3700 * 3701 * The email is sent to an administrator when an user request is confirmed. 3702 * 3703 * The following strings have a special meaning and will get replaced dynamically: 3704 * 3705 * ###SITENAME### The name of the site. 3706 * ###USER_EMAIL### The user email for the request. 3707 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. 3708 * ###MANAGE_URL### The URL to manage requests. 3709 * ###SITEURL### The URL to the site. 3710 * 3711 * For fulfillment email content use {@see 'user_erasure_fulfillment_email_content'} instead. 3712 * 3713 * @since 4.9.6 3714 * 3715 * @deprecated 5.8.0 Use {@see 'user_request_confirmed_email_content'} instead. For fulfillment email content use {@see 'user_erasure_fulfillment_email_content'} instead. 3716 * 3717 * @param string $content The email content. 3716 3718 * @param array $email_data { 3717 3719 * Data relating to the account action email. … … 3726 3728 * } 3727 3729 */ 3728 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data ); 3729 3730 $headers = ''; 3731 3732 /** 3733 * Filters the headers of the user request confirmation email. 3734 * 3735 * @since 5.4.0 3736 * 3737 * @param string|array $headers The email headers. 3738 * @param string $subject The email subject. 3739 * @param string $content The email content. 3740 * @param int $request_id The request ID. 3741 * @param array $email_data { 3730 $content = apply_filters_deprecated( 3731 'user_confirmed_action_email_content', 3732 array( $content, $email_data ), 3733 '5.8.0', 3734 sprintf( 3735 /* translators: 1 & 2: Deprecation replacement options */ 3736 __( '%1$s or %2$s' ), 3737 'user_request_confirmed_email_content', 3738 'user_erasure_fulfillment_email_content' 3739 ) 3740 ); 3741 3742 /** 3743 * Filters the body of the user request confirmation email. 3744 * 3745 * The email is sent to an administrator when an user request is confirmed. 3746 * The following strings have a special meaning and will get replaced dynamically: 3747 * 3748 * ###SITENAME### The name of the site. 3749 * ###USER_EMAIL### The user email for the request. 3750 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. 3751 * ###MANAGE_URL### The URL to manage requests. 3752 * ###SITEURL### The URL to the site. 3753 * 3754 * @since 5.8.0 3755 * 3756 * @param string $content The email content. 3757 * @param array $email_data { 3742 3758 * Data relating to the account action email. 3743 3759 * … … 3751 3767 * } 3752 3768 */ 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3753 3800 $headers = apply_filters( 'user_request_confirmed_email_headers', $headers, $subject, $content, $request_id, $email_data ); 3754 3801 … … 3818 3865 * Filters the subject of the email sent when an erasure request is completed. 3819 3866 * 3867 3868 3820 3869 * @since 4.9.8 3870 3871 3821 3872 * 3822 3873 * @param string $subject The email subject. … … 3834 3885 * } 3835 3886 */ 3836 $subject = apply_filters( 'user_erasure_complete_email_subject', $subject, $email_data['sitename'], $email_data ); 3837 3838 if ( empty( $email_data['privacy_policy_url'] ) ) { 3839 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3840 $email_text = __( 3841 'Howdy, 3842 3843 Your request to erase your personal data on ###SITENAME### has been completed. 3844 3845 If you have any follow-up questions or concerns, please contact the site administrator. 3846 3847 Regards, 3848 All at ###SITENAME### 3849 ###SITEURL###' 3850 ); 3851 } else { 3852 /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */ 3853 $email_text = __( 3854 'Howdy, 3855 3856 Your request to erase your personal data on ###SITENAME### has been completed. 3857 3858 If you have any follow-up questions or concerns, please contact the site administrator. 3859 3860 For more information, you can also read our privacy policy: ###PRIVACY_POLICY_URL### 3861 3862 Regards, 3863 All at ###SITENAME### 3864 ###SITEURL###' 3865 ); 3866 } 3867 3868 /** 3869 * Filters the body of the data erasure fulfillment notification. 3870 * 3871 * The email is sent to a user when a their data erasure request is fulfilled 3872 * by an administrator. 3873 * 3874 * The following strings have a special meaning and will get replaced dynamically: 3875 * 3876 * ###SITENAME### The name of the site. 3877 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3878 * ###SITEURL### The URL to the site. 3879 * 3880 * @since 4.9.6 3881 * 3882 * @param string $email_text Text in the email. 3887 $subject = apply_filters_deprecated( 'user_erasure_complete_email_subject', array( $subject, $email_data['sitename'], $email_data ), '5.8.0', 'user_erasure_fulfillment_email_subject' ); 3888 3889 /** 3890 * Filters the subject of the email sent when an erasure request is completed. 3891 * 3892 * @since 5.8.0 3893 * 3894 * @param string $subject The email subject. 3895 * @param string $sitename The name of the site. 3883 3896 * @param array $email_data { 3884 3897 * Data relating to the account action email. … … 3893 3906 * } 3894 3907 */ 3895 $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); 3896 3897 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3898 $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); 3899 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3900 3901 $headers = ''; 3902 3903 /** 3904 * Filters the headers of the data erasure fulfillment notification. 3905 * 3906 * @since 5.4.0 3907 * 3908 * @param string|array $headers The email headers. 3909 * @param string $subject The email subject. 3910 * @param string $content The email content. 3911 * @param int $request_id The request ID. 3912 * @param array $email_data { 3908 $subject = apply_filters( 'user_erasure_fulfillment_email_subject', $subject, $email_data['sitename'], $email_data ); 3909 3910 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3911 $content = __( 3912 // phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent 3913 'Howdy, 3914 3915 Your request to erase your personal data on ###SITENAME### has been completed. 3916 3917 If you have any follow-up questions or concerns, please contact the site administrator. 3918 3919 Regards, 3920 All at ###SITENAME### 3921 ###SITEURL###' 3922 ); 3923 3924 if ( ! empty( $email_data['privacy_policy_url'] ) ) { 3925 /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */ 3926 $content = __( 3927 // phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent 3928 'Howdy, 3929 3930 Your request to erase your personal data on ###SITENAME### has been completed. 3931 3932 If you have any follow-up questions or concerns, please contact the site administrator. 3933 3934 For more information, you can also read our privacy policy: ###PRIVACY_POLICY_URL### 3935 3936 Regards, 3937 All at ###SITENAME### 3938 ###SITEURL###' 3939 ); 3940 } 3941 3942 /** 3943 * Filters the body of the data erasure fulfillment notification. 3944 * 3945 * Use {@see 'user_erasure_fulfillment_email_content'} instead. 3946 * 3947 * The email is sent to a user when a their data erasure request is fulfilled 3948 * by an administrator. 3949 * 3950 * The following strings have a special meaning and will get replaced dynamically: 3951 * 3952 * ###SITENAME### The name of the site. 3953 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3954 * ###SITEURL### The URL to the site. 3955 * 3956 * For user request confirmation email content use {@see 'user_request_confirmed_email_content'} instead. 3957 * 3958 * @since 4.9.6 3959 * 3960 * @deprecated 5.8.0 Use {@see 'user_erasure_fulfillment_email_content'} instead. For user request confirmation email content use {@see 'user_request_confirmed_email_content'} instead. 3961 * 3962 * @param string $content The email content. 3963 * @param array $email_data { 3913 3964 * Data relating to the account action email. 3914 3965 * … … 3922 3973 * } 3923 3974 */ 3924 $headers = apply_filters( 'user_erasure_complete_email_headers', $headers, $subject, $content, $request_id, $email_data ); 3975 $content = apply_filters_deprecated( 3976 'user_confirmed_action_email_content', 3977 array( $content, $email_data ), 3978 '5.8.0', 3979 sprintf( 3980 /* translators: 1 & 2: Deprecation replacement options */ 3981 __( '%1$s or %2$s' ), 3982 'user_erasure_fulfillment_email_content', 3983 'user_request_confirmed_email_content' 3984 ) 3985 ); 3986 3987 /** 3988 * Filters the body of the data erasure fulfillment notification. 3989 * 3990 * The email is sent to a user when a their data erasure request is fulfilled 3991 * by an administrator. 3992 * 3993 * The following strings have a special meaning and will get replaced dynamically: 3994 * 3995 * ###SITENAME### The name of the site. 3996 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3997 * ###SITEURL### The URL to the site. 3998 * 3999 * @since 5.8.0 4000 * 4001 * @param string $content The email content. 4002 * @param array $email_data { 4003 * Data relating to the account action email. 4004 * 4005 * @type WP_User_Request $request User request object. 4006 * @type string $message_recipient The address that the email will be sent to. Defaults 4007 * to the value of `$request->email`, but can be changed 4008 * by the `user_erasure_fulfillment_email_to` filter. 4009 * @type string $privacy_policy_url Privacy policy URL. 4010 * @type string $sitename The site name sending the mail. 4011 * @type string $siteurl The site URL sending the mail. 4012 * } 4013 */ 4014 $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data ); 4015 4016 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 4017 $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); 4018 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 4019 4020 $headers = ''; 4021 4022 /** 4023 * Filters the headers of the data erasure fulfillment notification. 4024 * 4025 * Use {@see 'user_erasure_fulfillment_email_headers'} instead. 4026 * 4027 * @since 5.4.0 4028 * 4029 * @deprecated 5.8.0 Use {@see 'user_erasure_fulfillment_email_headers'} instead. 4030 * 4031 * @param string|array $headers The email headers. 4032 * @param string $subject The email subject. 4033 * @param string $content The email content. 4034 * @param int $request_id The request ID. 4035 * @param array $email_data { 4036 * Data relating to the account action email. 4037 * 4038 * @type WP_User_Request $request User request object. 4039 * @type string $message_recipient The address that the email will be sent to. Defaults 4040 * to the value of `$request->email`, but can be changed 4041 * by the `user_erasure_fulfillment_email_to` filter. 4042 * @type string $privacy_policy_url Privacy policy URL. 4043 * @type string $sitename The site name sending the mail. 4044 * @type string $siteurl The site URL sending the mail. 4045 * } 4046 */ 4047 $headers = apply_filters_deprecated( 'user_erasure_complete_email_headers', array( $headers, $subject, $content, $request_id, $email_data ), '5.8.0', 'user_erasure_fulfillment_email_headers' ); 4048 4049 /** 4050 * Filters the headers of the data erasure fulfillment notification. 4051 * 4052 * @since 5.7.0 4053 * 4054 * @param string|array $headers The email headers. 4055 * @param string $subject The email subject. 4056 * @param string $content The email content. 4057 * @param int $request_id The request ID. 4058 * @param array $email_data { 4059 * Data relating to the account action email. 4060 * 4061 * @type WP_User_Request $request User request object. 4062 * @type string $message_recipient The address that the email will be sent to. Defaults 4063 * to the value of `$request->email`, but can be changed 4064 * by the `user_erasure_fulfillment_email_to` filter. 4065 * @type string $privacy_policy_url Privacy policy URL. 4066 * @type string $sitename The site name sending the mail. 4067 * @type string $siteurl The site URL sending the mail. 4068 * } 4069 */ 4070 $headers = apply_filters( 'user_erasure_fulfillment_email_headers', $headers, $subject, $content, $request_id, $email_data ); 3925 4071 3926 4072 $email_sent = wp_mail( $user_email, $subject, $content, $headers ); … … 4120 4266 ); 4121 4267 4122 /* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */ 4123 $email_text = __( 4124 'Howdy, 4125 4126 A request has been made to perform the following action on your account: 4127 4128 ###DESCRIPTION### 4129 4130 To confirm this, please click on the following link: 4131 ###CONFIRM_URL### 4132 4133 You can safely ignore and delete this email if you do not want to 4134 take this action. 4135 4136 Regards, 4137 All at ###SITENAME### 4138 ###SITEURL###' 4139 ); 4140 4141 /** 4142 * Filters the text of the email sent when an account action is attempted. 4143 * 4144 * The following strings have a special meaning and will get replaced dynamically: 4145 * 4146 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. 4147 * ###CONFIRM_URL### The link to click on to confirm the account action. 4148 * ###SITENAME### The name of the site. 4149 * ###SITEURL### The URL to the site. 4268 /* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */ 4269 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] ); 4270 4271 /** 4272 * Filters the subject of the email sent when an account action is attempted. 4150 4273 * 4151 4274 * @since 4.9.6 4152 4275 * 4153 * @param string $email_text Text in the email. 4276 * @param string $subject The email subject. 4277 * @param string $sitename The name of the site. 4154 4278 * @param array $email_data { 4155 4279 * Data relating to the account action email. … … 4163 4287 * } 4164 4288 */ 4165 $content = apply_filters( 'user_request_action_email_content', $email_text, $email_data ); 4166 4167 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 4168 $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content ); 4169 $content = str_replace( '###EMAIL###', $email_data['email'], $content ); 4170 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 4171 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 4172 4173 /* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */ 4174 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] ); 4175 4176 /** 4177 * Filters the subject of the email sent when an account action is attempted. 4289 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 4290 4291 /* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */ 4292 $content = __( 4293 // phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent 4294 'Howdy, 4295 4296 A request has been made to perform the following action on your account: 4297 4298 ###DESCRIPTION### 4299 4300 To confirm this, please click on the following link: 4301 ###CONFIRM_URL### 4302 4303 You can safely ignore and delete this email if you do not want to 4304 take this action. 4305 4306 Regards, 4307 All at ###SITENAME### 4308 ###SITEURL###' 4309 ); 4310 4311 /** 4312 * Filters the text of the email sent when an account action is attempted. 4313 * 4314 * The following strings have a special meaning and will get replaced dynamically: 4315 * 4316 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. 4317 * ###CONFIRM_URL### The link to click on to confirm the account action. 4318 * ###SITENAME### The name of the site. 4319 * ###SITEURL### The URL to the site. 4178 4320 * 4179 4321 * @since 4.9.6 4180 4322 * 4181 * @param string $subject The email subject. 4182 * @param string $sitename The name of the site. 4323 * @param string $content Text in the email. 4183 4324 * @param array $email_data { 4184 4325 * Data relating to the account action email. … … 4192 4333 * } 4193 4334 */ 4194 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 4335 $content = apply_filters( 'user_request_action_email_content', $content, $email_data ); 4336 4337 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 4338 $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content ); 4339 $content = str_replace( '###EMAIL###', $email_data['email'], $content ); 4340 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 4341 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 4195 4342 4196 4343 $headers = ''; -
trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
r50969 r51129 211 211 */ 212 212 public function test_email_subject_should_be_filterable() { 213 add_filter( 'user_erasure_ complete_email_subject', array( $this, 'filter_email_subject' ) );213 add_filter( 'user_erasure__email_subject', array( $this, 'filter_email_subject' ) ); 214 214 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 215 215 … … 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__email_content', array( $this, 'filter_email_body_text' ) ); 240 240 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 241 241 … … 265 265 */ 266 266 public function test_email_headers_should_be_filterable() { 267 add_filter( 'user_erasure_ complete_email_headers', array( $this, 'modify_email_headers' ) );267 add_filter( 'user_erasure__email_headers', array( $this, 'modify_email_headers' ) ); 268 268 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 269 269 -
trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php
r50969 r51129 179 179 _wp_privacy_account_request_confirmed( $request_id ); 180 180 181 add_filter( 'user_ confirmed_action_email_content', array( $this, 'modify_email_content' ), 10, 2 );182 _wp_privacy_send_request_confirmation_notification( $request_id ); 183 remove_filter( 'user_ confirmed_action_email_content', array( $this, 'modify_email_content' ), 10 );181 add_filter( 'user__email_content', array( $this, 'modify_email_content' ), 10, 2 ); 182 _wp_privacy_send_request_confirmation_notification( $request_id ); 183 remove_filter( 'user__email_content', array( $this, 'modify_email_content' ), 10 ); 184 184 185 185 $mailer = tests_retrieve_phpmailer_instance();
Note: See TracChangeset
for help on using the changeset viewer.