21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-05 02:05:09 +02:00

Dynamic mailer configuration

This commit is contained in:
Colin Darie 2018-06-05 20:09:00 +02:00
parent dba1ab55d9
commit 8ff94076c0
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
4 changed files with 15 additions and 2 deletions

View file

@ -12,5 +12,9 @@ development:
<<: *default
host: "chexpire.local"
production:
action_mailer_config:
delivery_method: :sendmail
# test configuration included in file used by CI services
<%= IO.read Rails.root.join("config", "chexpire.test.yml") %>

View file

@ -44,6 +44,10 @@ Rails.application.configure do
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host"), port: 3000 }
config.chexpire.fetch("action_mailer_config", {}).each_pair do |key, value|
config.action_mailer[key] = value
end
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

View file

@ -65,10 +65,12 @@ Rails.application.configure do
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { host: 'chexpire.evolix.org' }
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host") }
config.chexpire.fetch("action_mailer_config", {}).each_pair do |key, value|
config.action_mailer[key] = value
end
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true

View file

@ -67,6 +67,9 @@ Rails.application.configure do
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host") }
config.chexpire.fetch("action_mailer_config", {}).each_pair do |key, value|
config.action_mailer[key] = value
end
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).