i have a workflow in which a user when gets approved by system. Gets his login credentials as username and password. I want to send the user when he is approved his username and password in a mail. I am not sure how can i retrieve a user password from database is there an already existing function in wordpress?
Wordpress doesn't store clear-text passwords. If you can, you'll have to generate a (new) password, update the wordpress database with the crypt hash (using wp_hash_password($clear_text_password)
) and send the cleartext password by email after that DB update succeeds.