Permalink
Browse files

Allow parent_mailer to be customizable via Devise.parent_mailer, usef…

…ul for engines
  • Loading branch information...
1 parent 6c2f51e commit cc017b1f0d41e999e05de684ce09848bcabbbf12 @jayshepherd jayshepherd committed Jan 18, 2013
Showing with 7 additions and 1 deletion.
  1. +1 −1 app/mailers/devise/mailer.rb
  2. +6 −0 lib/devise.rb
@@ -1,4 +1,4 @@
-class Devise::Mailer < ::ActionMailer::Base
+class Devise::Mailer < Devise.parent_mailer.constantize
include Devise::Mailers::Helpers
def confirmation_instructions(record, opts={})
View
@@ -199,6 +199,12 @@ module Strategies
mattr_accessor :parent_controller
@@parent_controller = "ApplicationController"
+ # The parent mailer all Devise mailers inherit from.
+ # Defaults to ActionMailer::Base. This should be set early
+ # in the initialization process and should be set to a string.
+ mattr_accessor :parent_mailer
+ @@parent_mailer = "ActionMailer::Base"
+
# The router Devise should use to generate routes. Defaults
# to :main_app. Should be overriden by engines in order
# to provide custom routes.

0 comments on commit cc017b1

Please sign in to comment.