Skip to content

Commit

Permalink
fix(smtp): Add authentication plain text only if user_name & password (
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois authored Dec 17, 2024
1 parent cded3f9 commit d8b0fd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,18 @@
config.action_mailer.default_url_options = { port: 3000 }
else
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
smtp_settings = {
address: Rails.application.secrets.smtp_address,
port: Rails.application.secrets.smtp_port,
authentication: Rails.application.secrets.smtp_authentication,
user_name: Rails.application.secrets.smtp_username,
password: Rails.application.secrets.smtp_password,
domain: Rails.application.secrets.smtp_domain,
enable_starttls_auto: Rails.application.secrets.smtp_starttls_auto,
openssl_verify_mode: "none"
}
smtp_settings = smtp_settings.merge(authentication: Rails.application.secrets.smtp_authentication) if smtp_settings[:user_name].present? && smtp_settings[:password].present?

config.action_mailer.smtp_settings = smtp_settings

if Rails.application.secrets.sendgrid
config.action_mailer.default_options = {
Expand Down

0 comments on commit d8b0fd2

Please sign in to comment.