Skip to content

Commit

Permalink
Only configure SMTP with env vars if in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgriffis committed Sep 19, 2019
1 parent 7c8bac5 commit 89ca935
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ class Application < Rails::Application
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.

config.action_mailer.smtp_settings = {
address: ENV['SMTP_HOSTNAME'],
port: ENV['SMTP_PORT'],
domain: ENV['SMTP_DOMAIN'],
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
authentication: ENV['SMTP_AUTH_TYPE'],
enable_starttls_auto: true
}
if ENV['DOCKER']
config.action_mailer.smtp_settings = {
address: ENV['SMTP_HOSTNAME'],
port: ENV['SMTP_PORT'],
domain: ENV['SMTP_DOMAIN'],
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
authentication: ENV['SMTP_AUTH_TYPE'],
enable_starttls_auto: true
}
end

end
end
Expand Down

0 comments on commit 89ca935

Please sign in to comment.