In environment.rb, rails is configured in the initializer block:
Rails::Initializer.run do |config|
config.action_mailer.smtp_settings = SETTINGS
end
This propagates to push the various config settings into the framework classes like ActionMailer::Base.smtp_settings.
If I need to reconfigure this outside the Initializer.run block, I can set:
Rails.configuration.action_mailer.smtp_settings = NEW_SETTINGS
But in this case it’s not picked up in ActionMailer::Base.smtp_settings.
Is there a way to make Rails “push” its updated configuration again? Or is it best to just reconfigure ActionMailer::Base directly and not worry that Rails.configuration is out of sync with it?
You should just use ActionMailer::Base class. The point of using Rails.configuration is to be able to set various options before actual code is loaded. If you need to change something afterwards, there is no need to use Rails.configuration.