about summary refs log tree commit diff
path: root/config/environments
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-04-07 13:32:12 +0200
committerGitHub <noreply@github.com>2022-04-07 13:32:12 +0200
commit8c03b45fffc54a66d1c9c3eec75a7c6f741d0947 (patch)
treee9e2c0324a97db0bf75d4d05133f2c184ef998b3 /config/environments
parent1b91359a4508b3068207ef4fd798a56549575591 (diff)
Fix unset `SMTP_RETURN_PATH` environment variable causing e-mail not to send (#17982)
Diffstat (limited to 'config/environments')
-rw-r--r--config/environments/production.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index b003cce9e..95f8a6f32 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -95,11 +95,12 @@ Rails.application.configure do
 
   config.action_mailer.default_options = {
     from: outgoing_email_address,
-    reply_to: ENV['SMTP_REPLY_TO'],
-    return_path: ENV['SMTP_RETURN_PATH'],
     message_id: -> { "<#{Mail.random_tag}@#{outgoing_email_domain}>" },
   }
 
+  config.action_mailer.default_options[:reply_to]    = ENV['SMTP_REPLY_TO'] if ENV['SMTP_REPLY_TO'].present?
+  config.action_mailer.default_options[:return_path] = ENV['SMTP_RETURN_PATH'] if ENV['SMTP_RETURN_PATH'].present?
+
   config.action_mailer.smtp_settings = {
     :port                 => ENV['SMTP_PORT'],
     :address              => ENV['SMTP_SERVER'],