I have developed one App using Phoenix-Elixir. Now i need to send OTP/Password for the registered users to their Emails. Which is the best and easy method to follow??
Are you saying you want to send a cleartext password to the user? If so, that’s generally speaking a horrible idea, because it suggests you’re storing your passwords in cleartext in your database, which would be a nightmare in case someone got a hold of the data.
As for sending e-mails, this repo has a good list:
I would highly recommend a quick glance there whenever you need to brush up on a corner of the eco-system.
OTP in this context means, “One Time Pad”, its used only once and thrown away. Most verification codes you get during double-opt-in processes are simply OTPs.
Also, even if you send them in the first mail in cleartext, that does not mean that you have them clear text in the database.
At no point was it specified that this was on registration and it’s always a bad idea to do anything with a cleartext password outside of hashing it and throwing it away.
And yes, the OTP part is my bad.
Here’s one way to send emails in Phoenix: https://sergiotapia.me/how-to-send-emails-from-phoenix-using-elixir-and-mandrill-8efbeb069a04
No actually I’m saving password encrypted in my database. I just want to send OTP for the user who register to my app via Email or Sms.
see this thread Passwordless Authentication in Phoenix
you can send sms with twilio or nexmo…