diff --git a/lib/railgun/railtie.rb b/lib/railgun/railtie.rb index 3c91a35..7d03de0 100644 --- a/lib/railgun/railtie.rb +++ b/lib/railgun/railtie.rb @@ -2,8 +2,11 @@ module Railgun class Railtie < ::Rails::Railtie - config.before_configuration do - ActionMailer::Base.add_delivery_method :mailgun, Railgun::Mailer + initializer "railgun.configure_rails_initialization" do + ActiveSupport.on_load(:action_mailer) do + add_delivery_method :mailgun, Railgun::Mailer + ActiveSupport.run_load_hooks(:mailgun_mailer, Railgun::Mailer) + end end end end