Skip to content

How To: Use custom mailer

coryschires edited this page May 30, 2012 · 2 revisions

To use a custom mailer, create a class that extends Devise::Mailer, like this:

class MyMailer < Devise::Mailer   
  helper :application # gives access to all helpers defined within `application_helper`.
end

Then, in your config/initializers/devise.rb, set config.mailer to "MyMailer".

You may now use your MyMailer in the same way as any other mailer, so you can e.g. define a method confirmation_instructions and implement it in a standard way.

Clone this wiki locally