From dc90ec519cd25ce542a1fa902c6f6aed2ad1064a Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 3 Nov 2016 18:26:21 +0200 Subject: [PATCH] Use "registrant_url" from env for all mailers --- config/application.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 2121039dc..dd3a1213e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,7 @@ module Registry # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - config.time_zone = ENV['time_zone'] || 'Tallinn' # NB! It should be defined, + config.time_zone = ENV['time_zone'] || 'Tallinn' # NB! It should be defined, # otherwise ActiveRecord usese other class internally. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. @@ -60,6 +60,10 @@ module Registry g.helper false end + registrant_portal_uri = URI.parse(ENV['registrant_url']) + config.action_mailer.default_url_options = { host: registrant_portal_uri.host, + protocol: registrant_portal_uri.scheme } + config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true