I\'ve installed Devise for my Rails app (3.0.1) and it\'s mostly working. I just can\'t seem customize the mailer views.
according to devise's docs
you should edit your config/initializers/devise.rb:
config.scoped_views = true
(it is commented by default)
by doing so, you can customize your views for different models, rather than the global devise.
If you want to generate JUST the email views, you can do it with: rails g devise:views [SCOPE] -v mailer. The [SCOPE] in your case is users.
Note: I'm using Devise 4.7.3.
To generate views by resource name
rails generate devise:views users
To generate specify views by module of recoverable
rails generate devise:views users -v passwords
To generate specify mail views only
rails generate devise:views users -v mailer
for more details generate views
If you are interested in not using Devise's default usage of ActionMailer and would instead like to send customized emails with an API from a service like SendGrid, Mailgun, or Postmark you will need to create a custom Mailer that subclasses Devise::Mailer and overrides its "notification" methods.
Here is an example using Mailgun.
Try this:
rails generate devise:views
I think you'll need to manage the Devise views yourself. Try the following in a console:
rails generate devise:views
This will generate all the views Devise uses (including mailer templates), which you can now customize.
The mailers you're looking for should then be in 'app/views/devise/mailer'
If you want to generate scoped views, or only a subset of them that is also possible. Per the documentation at https://github.com/plataformatec/devise#configuring-views:
You can also use the generator to generate scoped views:
rails generate devise:views users
If you would like to generate only a few sets of views, like the ones for the registerable and confirmable module, you can pass a list of modules to the generator with the -v flag.
rails generate devise:views -v registrations confirmations