From 17c706291c6f250e46300637f5b61c3b46bb0924 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 18 Apr 2018 10:29:59 +0800 Subject: [PATCH] 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. --- config/application.rb | 3 --- config/initializers/action_mailer.rb | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) 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 } -- 2.39.5