Use "registrant_url" from env for all mailers

This commit is contained in:
Artur Beljajev 2016-11-03 18:26:21 +02:00
parent b6c3daa781
commit dc90ec519c

View file

@ -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