Make WordPress Core

Changeset 51129


Ignore:
Timestamp:
06/09/2021 01:34:09 AM (3 years ago)
Author:
antpb
Message:

Privacy: Improve naming of user confimed action email filters.

The filters user_confirmed_action_email_content, user_erasure_complete_email_subject, and user_erasure_complete_email_headers have been deprecated.

They have been replaced with user_erasure_fulfillment_email_content, user_erasure_fulfillment_email_subject, and user_erasure_fulfillment_email_headers.

Props desrosj, garrett-eclipse, birgire, DrewAPicture, lifeforceinst, ocean90, pbiron, pento, coffee2code, TZ-Media, SergeyBiryukov, johnbillion, audrasjb, davidbaumwald, hellofromTonya, helen, xkon, antpb, peterwilsoncc, lukecarbis.
Fixes #44314.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/privacy-tools.php

    r50713 r51129  
    663663    /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
    664664    $email_text = __(
    665         'Howdy,
     665// phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent
     666'Howdy,
    666667
    667668Your request for an export of personal data has been completed. You may
  • trunk/src/wp-includes/user.php

    r51126 r51129  
    36473647    );
    36483648
    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
    36653654    );
    36663655
    36673656    /**
    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.
    36823663     * @param array  $email_data {
    36833664     *     Data relating to the account action email.
     
    36923673     * }
    36933674     */
    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
     3682A user data privacy request has been confirmed on ###SITENAME###:
     3683
     3684User: ###USER_EMAIL###
     3685Request: ###DESCRIPTION###
     3686
     3687You can view and manage these data privacy requests here:
     3688
     3689###MANAGE_URL###
     3690
     3691Regards,
     3692All at ###SITENAME###
     3693###SITEURL###'
    37073694    );
    37083695
    37093696    /**
    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.
    37163718     * @param array  $email_data {
    37173719     *     Data relating to the account action email.
     
    37263728     * }
    37273729     */
    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 {
    37423758     *     Data relating to the account action email.
    37433759     *
     
    37513767     * }
    37523768     */
     3769    $content = apply_filters( 'user_request_confirmed_email_content', $content, $email_data );
     3770
     3771    $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
     3772    $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );
     3773    $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
     3774    $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
     3775    $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
     3776
     3777    $headers = '';
     3778
     3779    /**
     3780     * Filters the headers of the user request confirmation email.
     3781     *
     3782     * @since 5.4.0
     3783     *
     3784     * @param string|array $headers    The email headers.
     3785     * @param string       $subject    The email subject.
     3786     * @param string       $content    The email content.
     3787     * @param int          $request_id The request ID.
     3788     * @param array        $email_data {
     3789     *     Data relating to the account action email.
     3790     *
     3791     *     @type WP_User_Request $request     User request object.
     3792     *     @type string          $user_email  The email address confirming a request
     3793     *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3794     *     @type string          $manage_url  The link to click manage privacy requests of this type.
     3795     *     @type string          $sitename    The site name sending the mail.
     3796     *     @type string          $siteurl     The site URL sending the mail.
     3797     *     @type string          $admin_email The administrator email receiving the mail.
     3798     * }
     3799     */
    37533800    $headers = apply_filters( 'user_request_confirmed_email_headers', $headers, $subject, $content, $request_id, $email_data );
    37543801
     
    38183865     * Filters the subject of the email sent when an erasure request is completed.
    38193866     *
     3867     * Use {@see 'user_erasure_fulfillment_email_subject'} instead.
     3868     *
    38203869     * @since 4.9.8
     3870     *
     3871     * @deprecated 5.8.0 Use {@see 'user_erasure_fulfillment_email_subject'} instead.
    38213872     *
    38223873     * @param string $subject    The email subject.
     
    38343885     * }
    38353886     */
    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.
    38833896     * @param array  $email_data {
    38843897     *     Data relating to the account action email.
     
    38933906     * }
    38943907     */
    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
     3915Your request to erase your personal data on ###SITENAME### has been completed.
     3916
     3917If you have any follow-up questions or concerns, please contact the site administrator.
     3918
     3919Regards,
     3920All 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
     3930Your request to erase your personal data on ###SITENAME### has been completed.
     3931
     3932If you have any follow-up questions or concerns, please contact the site administrator.
     3933
     3934For more information, you can also read our privacy policy: ###PRIVACY_POLICY_URL###
     3935
     3936Regards,
     3937All 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 {
    39133964     *     Data relating to the account action email.
    39143965     *
     
    39223973     * }
    39233974     */
    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 );
    39254071
    39264072    $email_sent = wp_mail( $user_email, $subject, $content, $headers );
     
    41204266    );
    41214267
    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.
    41504273     *
    41514274     * @since 4.9.6
    41524275     *
    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.
    41544278     * @param array  $email_data {
    41554279     *     Data relating to the account action email.
     
    41634287     * }
    41644288     */
    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
     4296A request has been made to perform the following action on your account:
     4297
     4298     ###DESCRIPTION###
     4299
     4300To confirm this, please click on the following link:
     4301###CONFIRM_URL###
     4302
     4303You can safely ignore and delete this email if you do not want to
     4304take this action.
     4305
     4306Regards,
     4307All 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.
    41784320     *
    41794321     * @since 4.9.6
    41804322     *
    4181      * @param string $subject    The email subject.
    4182      * @param string $sitename   The name of the site.
     4323     * @param string $content Text in the email.
    41834324     * @param array  $email_data {
    41844325     *     Data relating to the account action email.
     
    41924333     * }
    41934334     */
    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 );
    41954342
    41964343    $headers = '';
  • trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php

    r50969 r51129  
    211211     */
    212212    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_fulfillment_email_subject', array( $this, 'filter_email_subject' ) );
    214214        _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
    215215
     
    237237     */
    238238    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' ) );
    240240        _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
    241241
     
    265265     */
    266266    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_fulfillment_email_headers', array( $this, 'modify_email_headers' ) );
    268268        _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
    269269
  • trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php

    r50969 r51129  
    179179        _wp_privacy_account_request_confirmed( $request_id );
    180180
    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_request_confirmed_email_content', array( $this, 'modify_email_content' ), 10, 2 );
     182        _wp_privacy_send_request_confirmation_notification( $request_id );
     183        remove_filter( 'user_request_confirmed_email_content', array( $this, 'modify_email_content' ), 10 );
    184184
    185185        $mailer = tests_retrieve_phpmailer_instance();
Note: See TracChangeset for help on using the changeset viewer.