• Hi.

    One of my subscribers reported a problem when trying to reset his password: he received the email but the link allowing to reset his password was not there.

    I am able to reproduce the problem in my email client (Airmail 2 on OS X), but the link is there when I access the message with a web-mail. Inspecting the source code in my email client gave me some insight: the URL is actually there, surrounded by a <p> tag… and something else.

    If you dig in wp-login.php you got this:

    $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
    $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";

    Note the “<” and “>” surrounding the URL. In a plain text message that is not a problem, but in an HTML message… Well, I believe it becomes a self-closing HTML tag, and then disappears.

    I guess we can find a workaround by using something like this:
    $message = preg_replace( '@<(http[^> ]+)>@', '$1', $message );

    There is the filter 'retrieve_password_message' but it may be a good idea to cover all messages by using the filter 'wp_mail'.

    Cheers.
    Greg

    https://ww.wp.xz.cn/plugins/email-templates/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Reset password link disappearance’ is closed to new replies.