I'm using Devise for authentication, and I'm confused on how to set up mail along with it. Should you still be creating your own mailer and initializer file, or should you be sending all mail through Devise? Where do you go in Devise to create the email template and the method for sending the email?
I realize this is kind of a broad question, so essentially I'm asking what is the best way to set up mail with Devise?
Also, if you wanted to send an email to a user after they have confirmed their email, how would you do this?
Devise does create it's own Mailer--if you take a look on GitHub https://github.com/plataformatec/devise/blob/master/app/mailers/devise/mailer.rb you can see that it comes with a bunch of methods already packaged in.
You can go ahead and generate the views for these methods using the command
rails g devise views
and then edit them.
If you would like to send additional email messages you should create your own Mailer to do so. I would recommend http://edgeguides.rubyonrails.org/action_mailer_basics.html . It's a pretty good overview of how to set up a mailer from the ground up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With