chore: Fix SMTP mailer config defaults (#1923)
This commit is contained in:
parent
fe8fc570f6
commit
e44e9fc025
1 changed files with 3 additions and 3 deletions
|
@ -13,16 +13,16 @@ Rails.application.configure do
|
|||
|
||||
# Config related to smtp
|
||||
smtp_settings = {
|
||||
domain: ENV.fetch('SMTP_DOMAIN', ''),
|
||||
address: ENV.fetch('SMTP_ADDRESS', 'localhost'),
|
||||
port: ENV.fetch('SMTP_PORT', 587)
|
||||
}
|
||||
|
||||
smtp_settings[:authentication] = ENV.fetch('SMTP_AUTHENTICATION', 'login').to_sym if ENV.fetch('SMTP_AUTHENTICATION', '').present?
|
||||
smtp_settings[:authentication] = ENV.fetch('SMTP_AUTHENTICATION', 'login').to_sym if ENV['SMTP_AUTHENTICATION'].present?
|
||||
smtp_settings[:domain] = ENV['SMTP_DOMAIN'] if ENV['SMTP_DOMAIN'].present?
|
||||
smtp_settings[:user_name] = ENV['SMTP_USERNAME']
|
||||
smtp_settings[:password] = ENV['SMTP_PASSWORD']
|
||||
smtp_settings[:enable_starttls_auto] = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SMTP_ENABLE_STARTTLS_AUTO', true))
|
||||
smtp_settings[:openssl_verify_mode] = ENV.fetch('SMTP_OPENSSL_VERIFY_MODE', 'peer')
|
||||
smtp_settings[:openssl_verify_mode] = ENV['SMTP_OPENSSL_VERIFY_MODE'] if ENV['SMTP_OPENSSL_VERIFY_MODE'].present?
|
||||
smtp_settings[:ssl] = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SMTP_SSL', true)) if ENV['SMTP_SSL']
|
||||
smtp_settings[:tls] = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SMTP_TLS', true)) if ENV['SMTP_TLS']
|
||||
|
||||
|
|
Loading…
Reference in a new issue