Skip to main content
added 182 characters in body
Source Link
butlerblog
  • 5.1k
  • 3
  • 26
  • 42

Use like this.

add_filter( 
  'password_change_email', 
  'wpse207879_change_password_mail_message', 
  10, 
  3 
 );
function wpse207879_change_password_mail_message( 
  $pass_change_mail, 
  $user, 
  $userdata 
 ) {
  $new_message_txt = __( 'Some text ###USERNAME### more text
      even more text ###EMAIL### more text after more text
      last bit of text ###SITENAME###' );
  $pass_change_mail[ 'message' ] = $new_message_txt;
  return $pass_change_mail;
}

Reference of the above code is: Change Password notification text on mail

This filter is in the wp_update_user() function and is documented here.

Use like this.

add_filter( 
  'password_change_email', 
  'wpse207879_change_password_mail_message', 
  10, 
  3 
 );
function wpse207879_change_password_mail_message( 
  $pass_change_mail, 
  $user, 
  $userdata 
 ) {
  $new_message_txt = __( 'Some text ###USERNAME### more text
    even more text ###EMAIL### more text after more text
    last bit of text ###SITENAME###' );
  $pass_change_mail[ 'message' ] = $new_message_txt;
  return $pass_change_mail;
}

Reference of the above code is: Change Password notification text on mail

Use like this.

add_filter( 'password_change_email', 'wpse207879_change_password_mail_message', 10, 3 );
function wpse207879_change_password_mail_message( $pass_change_mail, $user, $userdata ) {
  $new_message_txt = __( 'Some text ###USERNAME### more text
      even more text ###EMAIL### more text after more text
      last bit of text ###SITENAME###' );
  $pass_change_mail[ 'message' ] = $new_message_txt;
  return $pass_change_mail;
}

Reference of the above code is: Change Password notification text on mail

This filter is in the wp_update_user() function and is documented here.

Source Link

Use like this.

add_filter( 
  'password_change_email', 
  'wpse207879_change_password_mail_message', 
  10, 
  3 
);
function wpse207879_change_password_mail_message( 
  $pass_change_mail, 
  $user, 
  $userdata 
) {
  $new_message_txt = __( 'Some text ###USERNAME### more text
    even more text ###EMAIL### more text after more text
    last bit of text ###SITENAME###' );
  $pass_change_mail[ 'message' ] = $new_message_txt;
  return $pass_change_mail;
}

Reference of the above code is: Change Password notification text on mail