From a92d1d82c1249ecb1db596b2d13814dd416675e5 Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Mon, 24 Jul 2023 00:53:12 +0300 Subject: [PATCH] #23 allow smtp configure without requiring smtp user --- config/environments/production.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 34b3443d..00f07cea 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -76,7 +76,7 @@ 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['SMTP_USERNAME'] + if ENV['SMTP_ADDRESS'] config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: ENV.fetch('SMTP_ADDRESS', nil), @@ -86,7 +86,7 @@ Rails.application.configure do password: ENV.fetch('SMTP_PASSWORD', nil), authentication: ENV.fetch('SMTP_AUTHENTICATION', 'plain'), enable_starttls_auto: ENV['SMTP_ENABLE_STARTTLS_AUTO'] == 'true' - } + }.compact end # Enable locale fallbacks for I18n (makes lookups for any locale fall back to