WordPress – Change Password notification text on E-mail

The WordPress is the most popular and highest used CMS framework. WordPress provide hook functionality. Using hook functionality we can change the WordPress default functionality without touching the WordPress file.

Let’s how we can change the text of Change password notification E-mail text using Hook.

WordPress provide password_change_email Filter hook for change the text of E-mail. Let’s write that hook on functions.php file on the active theme.

add_filter( 'password_change_email', 'thecodingstuff_change_password_mail_text', 10, 3 );
function thecodingstuff_change_password_mail_text( $pass_change_mail, $user, $userdata ) {
  $emailContent = __( 'Hi ###USERNAME###,

    This notice confirms that your password was changed on ###SITENAME###.

    If you did not change your password, please contact the Site Administrator at
    ###ADMIN_EMAIL###

    This email has been sent to ###EMAIL###

    Regards,
    TheCodingStuff' );

  $pass_change_mail[ 'message' ] = $emailContent;

  return $pass_change_mail;
}

Using WordPress we can able to change the text of the password change e-mail message like above.

If you face any issue after using above hook write the comment below.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s