I need to change the default email text that will be sent to recover the password.
I have already changed the mail of activation in multisite:
// Start changing email body
function myprefix_change_activation_email_body ($old_body, $domain, $path, $title, $user, $user_email, $key, $meta) {
$my_message .= "nnhello {$user} ,welcome to {$domain} !nn";
// ... other stuff
return $my_message;
}
add_filter('wpmu_signup_blog_notification_email', 'myprefix_change_activation_email_body', 10, 8);
// End changing email body
// Start changing email subject
function myprefix_change_activation_email_subject ($old_subject, $domain, $path, $title, $user, $user_email, $key, $meta) {
$my_subject = "my subject";
return $my_subject;
}
add_filter('wpmu_signup_blog_notification_subject', 'myprefix_change_activation_email_subject', 10, 8);
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.retrieve_password_title
for the the email subject.Take a look at the
retrieve_password
function which you can find inwp-login.php
.