2009-12-23 20:01:07 -05:00
|
|
|
require "action_mailer"
|
2009-12-31 15:28:48 -05:00
|
|
|
require "rails"
|
2009-12-23 20:01:07 -05:00
|
|
|
|
|
|
|
module ActionMailer
|
2009-12-31 16:11:54 -05:00
|
|
|
class Railtie < Rails::Railtie
|
2010-03-26 13:47:55 -04:00
|
|
|
config.action_mailer = ActiveSupport::OrderedOptions.new
|
2009-12-23 20:01:07 -05:00
|
|
|
|
2010-02-05 00:11:09 -05:00
|
|
|
initializer "action_mailer.url_for", :before => :load_environment_config do |app|
|
2010-03-29 20:08:08 -04:00
|
|
|
ActiveSupport.on_load(:action_mailer) { include app.routes.url_helpers }
|
2010-02-05 00:11:09 -05:00
|
|
|
end
|
|
|
|
|
2010-02-15 09:44:30 -05:00
|
|
|
require "action_mailer/railties/log_subscriber"
|
2010-03-26 13:47:55 -04:00
|
|
|
log_subscriber :action_mailer, ActionMailer::Railties::LogSubscriber.new
|
2010-01-13 05:56:11 -05:00
|
|
|
|
2010-01-24 19:06:12 -05:00
|
|
|
initializer "action_mailer.logger" do
|
2010-03-29 20:08:08 -04:00
|
|
|
ActiveSupport.on_load(:action_mailer) { self.logger ||= Rails.logger }
|
2010-01-24 19:06:12 -05:00
|
|
|
end
|
|
|
|
|
2009-12-23 20:01:07 -05:00
|
|
|
initializer "action_mailer.set_configs" do |app|
|
2010-03-29 20:08:08 -04:00
|
|
|
ActiveSupport.on_load(:action_mailer) do
|
2010-03-07 09:24:30 -05:00
|
|
|
app.config.action_mailer.each do |k,v|
|
|
|
|
send "#{k}=", v
|
|
|
|
end
|
2009-12-23 20:01:07 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2010-02-05 00:11:09 -05:00
|
|
|
end
|