Customizing lost password email

You want the filters…

retrieve_password_message for the actual email content. Your hooked function will get the message as the first argument and the user’s reset key as the second.

<?php
add_filter('retrieve_password_message', 'wpse103299_reset_msg', 10, 2);
function wpse103299_reset_msg($message, $reset_key)
{
    // ...
}

retrieve_password_title for the the email subject.

<?php
add_filter('retrieve_password_title', 'wpse103299_reset_subject');
function wpse103299_reset_subject($subject)
{
    // ...
}

Take a look at the retrieve_password function which you can find in wp-login.php.

Leave a Comment