aboutsummaryrefslogblamecommitdiffstats
path: root/actionmailer/lib/action_mailer/railtie.rb
blob: fbbcf98854547363bca405ec21afa5edef0ba330 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                       
               

                   
                                
                               
 


                                                     









                                                                                  

     
require "action_mailer"
require "rails"

module ActionMailer
  class Railtie < Rails::Railtie
    railtie_name :action_mailer

    require "action_mailer/railties/subscriber"
    subscriber ActionMailer::Railties::Subscriber.new

    initializer "action_mailer.set_configs" do |app|
      app.config.action_mailer.each do |k,v|
        ActionMailer::Base.send "#{k}=", v
      end
    end

    # TODO: ActionController::Base.logger should delegate to its own config.logger
    initializer "action_mailer.logger" do
      ActionMailer::Base.logger ||= Rails.logger
    end
  end
end