2658
2658
update_user_meta( $current_user->ID, '_new_email', $new_user_email );
2660
if ( is_multisite() ) {
2661
$sitename = get_site_option( 'site_name' );
2663
$sitename = get_option( 'blogname' );
2660
$sitename = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
2666
2662
/* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
2667
2663
$email_text = __( 'Howdy ###USERNAME###,
2706
2702
$content = str_replace( '###USERNAME###', $current_user->user_login, $content );
2707
2703
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail=' . $hash ) ), $content );
2708
2704
$content = str_replace( '###EMAIL###', $_POST['email'], $content );
2709
$content = str_replace( '###SITENAME###', wp_specialchars_decode( $sitename, ENT_QUOTES ), $content );
2710
$content = str_replace( '###SITEURL###', network_home_url(), $content );
2705
$content = str_replace( '###SITENAME###', $sitename, $content );
2706
$content = str_replace( '###SITEURL###', home_url(), $content );
2712
wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
2708
wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), $sitename ), $content );
2714
2710
$_POST['email'] = $current_user->user_email;
2899
/* translators: %s Site name. */
2900
__( '[%s] Action Confirmed' ),
2901
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
2904
$manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
2894
$manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
2895
$action_description = wp_user_request_action_description( $request_data->action_name );
2907
2898
* Filters the recipient of the data request confirmation notification.
2922
2913
$email_data = array(
2923
2914
'request' => $request_data,
2924
2915
'user_email' => $request_data->email,
2925
'description' => wp_user_request_action_description( $request_data->action_name ),
2916
'description' => $action_description,
2926
2917
'manage_url' => $manage_url,
2927
'sitename' => get_option( 'blogname' ),
2918
'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
2928
2919
'siteurl' => home_url(),
2929
2920
'admin_email' => $admin_email,
2971
2962
* @type string $manage_url The link to click manage privacy requests of this type.
2972
2963
* @type string $sitename The site name sending the mail.
2973
2964
* @type string $siteurl The site URL sending the mail.
2965
* @type string $admin_email The administrator email receiving the mail.
2976
2968
$content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
2978
$content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );
2970
$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
2979
2971
$content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );
2980
2972
$content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
2981
2973
$content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
2982
2974
$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
2977
/* translators: 1: Site name. 2: Name of the confirmed action. */
2978
__( '[%1$s] Action Confirmed: %2$s' ),
2979
$email_data['sitename'],
2984
* Filters the subject of the user request confirmation email.
2988
* @param string $subject The email subject.
2989
* @param string $sitename The name of the site.
2990
* @param array $email_data {
2991
* Data relating to the account action email.
2993
* @type WP_User_Request $request User request object.
2994
* @type string $user_email The email address confirming a request
2995
* @type string $description Description of the action being performed so the user knows what the email is for.
2996
* @type string $manage_url The link to click manage privacy requests of this type.
2997
* @type string $sitename The site name sending the mail.
2998
* @type string $siteurl The site URL sending the mail.
2999
* @type string $admin_email The administrator email receiving the mail.
3002
$subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );
2984
3004
$email_sent = wp_mail( $email_data['admin_email'], $subject, $content );
2986
3006
if ( $email_sent ) {
3014
/* translators: %s Site name. */
3015
__( '[%s] Erasure Request Fulfilled' ),
3016
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
3020
3034
* Filters the recipient of the data erasure fulfillment notification.
3030
3044
'request' => $request_data,
3031
3045
'message_recipient' => $user_email,
3032
3046
'privacy_policy_url' => get_privacy_policy_url(),
3033
'sitename' => get_option( 'blogname' ),
3047
'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
3034
3048
'siteurl' => home_url(),
3052
/* translators: %s: Site name. */
3053
__( '[%s] Erasure Request Fulfilled' ),
3054
$email_data['sitename']
3058
* Filters the subject of the email sent when an erasure request is completed.
3062
* @param string $subject The email subject.
3063
* @param string $sitename The name of the site.
3064
* @param array $email_data {
3065
* Data relating to the account action email.
3067
* @type WP_User_Request $request User request object.
3068
* @type string $message_recipient The address that the email will be sent to. Defaults
3069
* to the value of `$request->email`, but can be changed
3070
* by the `user_erasure_fulfillment_email_to` filter.
3071
* @type string $privacy_policy_url Privacy policy URL.
3072
* @type string $sitename The site name sending the mail.
3073
* @type string $siteurl The site URL sending the mail.
3076
$subject = apply_filters( 'user_erasure_complete_email_subject', $subject, $email_data['sitename'], $email_data );
3037
3078
if ( empty( $email_data['privacy_policy_url'] ) ) {
3038
3079
/* translators: Do not translate SITENAME, SITEURL; those are placeholders. */
3039
3080
$email_text = __(
3094
3135
$content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
3096
$content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );
3137
$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
3097
3138
$content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );
3098
3139
$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
3251
3292
$email_data = array(
3293
'request' => $request,
3252
3294
'email' => $request->email,
3253
3295
'description' => wp_user_request_action_description( $request->action_name ),
3254
3296
'confirm_url' => add_query_arg( array(
3255
3297
'action' => 'confirmaction',
3256
3298
'request_id' => $request_id,
3257
3299
'confirm_key' => wp_generate_user_request_key( $request_id ),
3258
), site_url( 'wp-login.php' ) ),
3259
'sitename' => is_multisite() ? get_site_option( 'site_name' ) : get_option( 'blogname' ),
3260
'siteurl' => network_home_url(),
3300
), wp_login_url() ),
3301
'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
3302
'siteurl' => home_url(),
3263
3305
/* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */
3308
3350
$content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
3309
3351
$content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content );
3310
3352
$content = str_replace( '###EMAIL###', $email_data['email'], $content );
3311
$content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );
3353
$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
3312
3354
$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
3314
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
3316
3356
/* translators: Privacy data request subject. 1: Site name, 2: Name of the action */
3317
$subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $blogname, $email_data['description'] );
3357
$subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] );
3320
3360
* Filters the subject of the email sent when an account action is attempted.
3324
3364
* @param string $subject The email subject.
3325
* @param string $blogname The name of the site.
3365
* @param string $sitename The name of the site.
3326
3366
* @param array $email_data {
3327
3367
* Data relating to the account action email.
3334
3374
* @type string $siteurl The site URL sending the mail.
3337
$subject = apply_filters( 'user_request_action_email_subject', $subject, $blogname, $email_data );
3377
$subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );
3339
3379
return wp_mail( $email_data['email'], $subject, $content );