Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2025
    dweb360
    Participant

    Hello,
    When a user is registred on my website, his role is pending
    1) How can i send him notification email contening his password after genarating a new password for him ?
    2) Is it possible via code, to change user role and send him a new password ?
    Thank you

    #2035
    Vladimir
    Keymaster

    Hello,

    It’s not too secure to send passwords via e-mail. That’s why WordPress uses reset password technique. Why do not use this feature?
    User inputs his email after click on the ‘reset password’ link at login page (wp-login.php?action=lostpassword) and gets by email a special protected link to a page, where he can input his new password.

    #2037
    dweb360
    Participant

    Hello,
    Thank you for your reply
    Just a question :

    using this code :

    $user_info = get_userdata( $user_id );

    when i send an email :

    $message .= sprintf(__(‘Password: %s’), $user_info->user_pass) . “\r\n”;

    The emailed password is not in plain text but in this format : $P$BACj802h.27StS.k.bvccXpbGl3mVT0

    Do you know how to send the plain text password ?

    Thank you

    #2038
    Vladimir
    Keymaster

    WordPress does not store user password at the database. It stores just a password hash value. So it’s not possible to get user password in its original not encrypted form from the database. You should catch a password value earlier, when you change it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.