I'm trying to add custom wording to the basic WordPress registration password set/reset email. I'm using the plugin New User Approve to approve all users, but that doesn't seem to impact my issue. The problem is that the password set/rest link I'm emailing is identical to the default Wordpress link - except of course for the keys - but it doesn't work.
The default WordPress emailed link looks like this:
https://example.com/wp-login.php?action=rp&key=gicOc3FFIcDzf5WZvKBV&login=username
My emailed link looks like this:
https://example.com/wp-login.php?action=rp&key=V9gnJAe359tkn2dPOMXo&login=username
The default link works; my link throws the message "Your password reset link appears to be invalid. Please request a new link below."
How can I get my custom email to link to the password setting page
https://example.com/wp-login.php?action=rp
and not https://example.com/wp-login.php?action=lostpassword&error=invalidkey
Is the key not valid? Expired? Not output correctly? Using rawurlencode($user_login);
from Check Password Reset Key Not Woking does not help.
To generate the custom email, I'm using
function my_custom_message( $message, $user ) {
$user_login = stripslashes($user->user_login);
$key = get_password_reset_key( $user_data );
$rp_link = wp_login_url() ."?action=rp&key=$key&login=" . rawurlencode($user_login);
return $rp_link;
}
return $rp_link;
}
// add a new custom approval message
add_filter( 'new_user_approve_approve_user_message', 'my_custom_message', 10, 2 );
rawurlencode($user_login)
does not help.