Ruby/Rails: How do you customize the mailer templates of Devise?

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

Leave a Comment

tech