Replace generic "Dear user" greeting in email notifications with a more personalized one.

props Ipstenu.
fixes #31217.

git-svn-id: https://develop.svn.wordpress.org/trunk@31403 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-02-10 07:46:50 +00:00
parent c8a361712b
commit edeb3f3ae3
4 changed files with 16 additions and 6 deletions

View File

@ -253,10 +253,11 @@ function update_option_new_admin_email( $old_value, $value ) {
);
update_option( 'adminhash', $new_admin_email );
$email_text = __( 'Dear user,
$email_text = __( 'Howdy ###USERNAME###,
You recently requested to have the administration email address on
your site changed.
If this is correct, please click on the following link to change it:
###ADMIN_URL###
@ -273,6 +274,7 @@ All at ###SITENAME###
* Filter the email text sent when the site admin email is changed.
*
* The following strings have a special meaning and will get replaced dynamically:
* ###USERNAME### The current user's username.
* ###ADMIN_URL### The link to click on to confirm the email change. Required otherwise this functunalty is will break.
* ###EMAIL### The new email.
* ###SITENAME### The name of the site.
@ -285,6 +287,7 @@ All at ###SITENAME###
*/
$content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );
$content = str_replace( '###USERNAME###', $current_user->user_login, $content );
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content );
$content = str_replace( '###EMAIL###', $value, $content );
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
@ -331,9 +334,10 @@ function send_confirmation_on_profile_email() {
);
update_option( $current_user->ID . '_new_email', $new_user_email );
$email_text = __( 'Dear user,
$email_text = __( 'Howdy ###USERNAME###,
You recently requested to have the email address on your account changed.
If this is correct, please click on the following link to change it:
###ADMIN_URL###
@ -350,6 +354,7 @@ All at ###SITENAME###
* Filter the email text sent when a user changes emails.
*
* The following strings have a special meaning and will get replaced dynamically:
* ###USERNAME### The current user's username.
* ###ADMIN_URL### The link to click on to confirm the email change. Required otherwise this functunalty is will break.
* ###EMAIL### The new email.
* ###SITENAME### The name of the site.
@ -362,6 +367,7 @@ All at ###SITENAME###
*/
$content = apply_filters( 'new_user_email_content', $email_text, $new_user_email );
$content = str_replace( '###USERNAME###', $current_user->user_login, $content );
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content );
$content = str_replace( '###EMAIL###', $_POST['email'], $content);
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );

View File

@ -917,7 +917,7 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
$site_admins = get_site_option( 'site_admins' );
}
$welcome_email = __( 'Dear User,
$welcome_email = __( 'Howdy USERNAME,
Your new SITE_NAME site has been successfully set up at:
BLOG_URL

View File

@ -26,6 +26,7 @@ if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' )
}
$blog = get_blog_details();
$user = wp_get_current_user();
$title = __( 'Delete Site' );
$parent_file = 'tools.php';
@ -42,9 +43,11 @@ if ( isset( $_POST['action'] ) && $_POST['action'] == 'deleteblog' && isset( $_P
$url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) );
$content = __( "Dear User,
$content = __( "Howdy ###USERNAME###,
You recently clicked the 'Delete Site' link on your site and filled in a
form on that page.
If you really want to delete your site, click the link below. You will not
be asked to confirm again so only click this link if you are absolutely certain:
###URL_DELETE###
@ -65,6 +68,7 @@ Webmaster
*/
$content = apply_filters( 'delete_site_email_content', $content );
$content = str_replace( '###USERNAME###', $user->user_login, $content );
$content = str_replace( '###URL_DELETE###', $url_delete, $content );
$content = str_replace( '###SITE_NAME###', $current_site->site_name, $content );

View File

@ -1434,7 +1434,7 @@ function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta
$welcome_email = get_site_option( 'welcome_email' );
if ( $welcome_email == false )
$welcome_email = __( 'Dear User,
$welcome_email = __( 'Howdy USERNAME,
Your new SITE_NAME site has been successfully set up at:
BLOG_URL
@ -2080,7 +2080,7 @@ function users_can_register_signup_filter() {
function welcome_user_msg_filter( $text ) {
if ( !$text ) {
remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
$text = __( 'Dear User,
$text = __( 'Howdy USERNAME,
Your new account is set up.