From: Andy Allan Date: Wed, 18 Apr 2018 02:29:59 +0000 (+0800) Subject: Move the default_url_options config to the action_mailer initializer X-Git-Tag: live~3665^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/17c706291c6f250e46300637f5b61c3b46bb0924 Move the default_url_options config to the action_mailer initializer We can't use Rails.application.config here because the initializers run after ActionMailer::Base has been set up. --- diff --git a/config/application.rb b/config/application.rb index 3220ab591..b6e2ba467 100644 --- a/config/application.rb +++ b/config/application.rb @@ -43,8 +43,5 @@ module OpenStreetMap config.logstasher.logger_path = LOGSTASH_PATH config.logstasher.log_controller_parameters = true end - - # Set the host and protocol for all action mailer urls - config.action_mailer.default_url_options = { :host => SERVER_URL, :protocol => SERVER_PROTOCOL } end end diff --git a/config/initializers/action_mailer.rb b/config/initializers/action_mailer.rb index 6b27bb686..021a4c25d 100644 --- a/config/initializers/action_mailer.rb +++ b/config/initializers/action_mailer.rb @@ -5,3 +5,6 @@ ActionMailer::Base.smtp_settings = { :domain => "localhost", :enable_starttls_auto => false } + +# Set the host and protocol for all action mailer urls +ActionMailer::Base.default_url_options = { :host => SERVER_URL, :protocol => SERVER_PROTOCOL }