questions

retrieve_password_message is not working as i use for password retrive message

Rate this post

I have used the bellow code. But it is not working.

function site_change_password_mail_message( $message, $key ) {
$message = __( 'Hi ###USERNAME###,

This notice confirms that your password was changed on JDRF. If you did not change your password, please
contact JDRF Support at siteurl.com/inquiry. This email has been sent to ###EMAIL###.

Regards,
All at siteurl.com
[Application Homepage, ex. ###SITEURL###]');
return $message;
}
add_filter( 'retrieve_password_message', 'site_change_password_mail_message', 10, 3 );

Should i change this ? I am still getting this message.

Hi ranjit,

Someone has requested a new password for the following account on K Gems & Crystals:

Username: username

If you didn't make this request, just ignore this email. If you'd like to proceed:

Click here to reset your password

Thanks for reading.

 

✔️Solution:

I can see that you are not using proper arguments to the filter what you are using. You need to use proper argument to the filter. Try this code

add_filter( 'retrieve_password_message', 'retrive_reset_password_msg', 10, 4 );
function retrive_reset_password_msg( $message, $key, $user_login, $user_data ) {
    $message = __( 'Hi ###USERNAME###,

    This notice confirms that your password was changed on JDRF. If you did not change your password, please
    contact JDRF Support at siteurl.com/inquiry. This email has been sent to ###EMAIL###.

    Regards,
    All at siteurl.com
    [Application Homepage, ex. ###SITEURL###]');
    return $message;
}

Leave a Reply

Your email address will not be published.

Back to top button