[ENV] Mailjet delivery method
This commit is contained in:
parent
907f48e148
commit
bd574b21f6
2 changed files with 17 additions and 0 deletions
|
@ -67,6 +67,20 @@ Rails.application.configure do
|
||||||
# Set this to true and configure the email server for immediate delivery to raise 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.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
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# the I18n.default_locale when a translation cannot be found).
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
config.i18n.fallbacks = true
|
config.i18n.fallbacks = true
|
||||||
|
|
|
@ -39,6 +39,9 @@ defaults: &defaults
|
||||||
openstack_region: <%= ENV['FOG_OPENSTACK_REGION'] %>
|
openstack_region: <%= ENV['FOG_OPENSTACK_REGION'] %>
|
||||||
base_url: <% ENV['FOG_BASE_URL'] %>
|
base_url: <% ENV['FOG_BASE_URL'] %>
|
||||||
directory: <%= ENV['FOG_DIRECTORY'] %>
|
directory: <%= ENV['FOG_DIRECTORY'] %>
|
||||||
|
mailtrap:
|
||||||
|
username: <%= ENV['MAILTRAP_USERNAME'] %>
|
||||||
|
password: <%= ENV['MAILTRAP_PASSWORD'] %>
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue