[ENV] Mailjet delivery method

This commit is contained in:
Paul Chavard 2018-08-13 15:28:54 +02:00
parent 907f48e148
commit bd574b21f6
2 changed files with 17 additions and 0 deletions

View file

@ -67,6 +67,20 @@ Rails.application.configure do
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
if ENV['MAILTRAP_ENABLED'] == 'enabled'
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
user_name: Rails.application.secrets.mailtrap[:username],
password: Rails.application.secrets.mailtrap[:password],
address: 'smtp.mailtrap.io',
domain: 'smtp.mailtrap.io',
port: '2525',
authentication: :cram_md5
}
else
config.action_mailer.delivery_method = :mailjet
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

@ -39,6 +39,9 @@ defaults: &defaults
openstack_region: <%= ENV['FOG_OPENSTACK_REGION'] %>
base_url: <% ENV['FOG_BASE_URL'] %>
directory: <%= ENV['FOG_DIRECTORY'] %>
mailtrap:
username: <%= ENV['MAILTRAP_USERNAME'] %>
password: <%= ENV['MAILTRAP_PASSWORD'] %>
development:
<<: *defaults