Is it possible to send password variable via Sendgrid?

On my site, when an admin creates an account for another user, it creates a random password. Is it possible to send this random password variable to Sendgrid?

When setting up the workflow I cant seem to refer back to “result of step 1” and grab the password.

All my emails go via Sendgrid bar this one so would be nice to finish the platform off with styled emails.

Appreciate any advise

You really shouldn’t send passwords per mail.

Instead, send a unique link to set up a password on their own.

@reger-alexander Thats a very good point!

So I should create a secondary forget password page and then email that link to the user in the email. Asking them to set their own password although their account has already been created for them.

Would that be the best approach?

That would be possible, for better UX I would do it this way:

On creation of the user, create a random string (e.g. sdfsfdn123asdf) and save it in a user field. Then send a link to a page especially for setting up the password in the mail, e.g. testpage.com/set_pw?code=sdfsfdn123asdf.

On the page, load the code from the url and search for the user with the code value. Let them then set the password and delete the code from the user afterwards, so it can’t be done twice.

That is genius ! Thanks @reger-alexander much better way of doing it and safer. Marked as solved :clap::clap:

This topic was automatically closed after 70 days. New replies are no longer allowed.