• Hello, is that possible? To send password reset email to user with clickable button instead of that ugly long token? I will appresiate all suggestions. Thank you in advance.
    Mark

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Almost anything is possible with the right custom code 🙂

    One thing is the email has to be sent as HTML, the default type is “text/plain”. Use the “wp_mail_content_type” filter to set the type as “text/html”.

    Then use the “retrieve_password_message” filter to modify the message to have the link appear as a button. It’d be better to use the passed key and user data to compose a new message, rather than attempt to modify the existing message by string manipulation. You can add the above mentioned content type filter from this callback as well.

    After the message is sent, best practice is to remove the content type filter so any other messages are sent as the default type. This can actually be done from the “phpmailer_init” action even though the message hasn’t quite yet been sent because the content type filter had already been used for the current message this point.

Viewing 1 replies (of 1 total)
  • The topic ‘Password reset link/token in form of a button?’ is closed to new replies.