[openstreetmap/openstreetmap-website] Set default_url_options for action_mailer (#1824)

Andy Allan notifications at github.com
Wed Apr 18 02:57:29 UTC 2018


gravitystorm commented on this pull request.



> @@ -43,5 +43,8 @@ class Application < Rails::Application
       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 }

Done. There's an order-of-loading issue with using `Rails.application.config` to achieve this in the initializer, so I just went with overriding ActionMailer::Base.default_url_options instead. That seems reasonable and matches the smtp_settings approach too.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1824#discussion_r182296660
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180417/6f16b5a8/attachment.html>


More information about the rails-dev mailing list