Hi Shubham,
we can easily achieve it as Abdul commented,
You have an anonymous registration page where the user will register himself with the help of his user id ( with the help of his email ID). With a click of the register button, we can pass the email ID entered in the field to the microflow connected to the register button and generate a random password with the help of Java action from the community commons module. we can have both email id and password being passed as a placeholders to the email and send the email to user
Refer the below blog to send email with placeholders
https://medium.com/mendix/how-to-send-styled-html-emails-using-email-module-with-templates-and-mxmodel-reflection-mendix-3d80d18019b9