Merge pull request #8818 from adullact/feat-smtp-emails
feat: allow classic SMTP for email sending
This commit is contained in:
commit
0279966a98
2 changed files with 20 additions and 0 deletions
|
@ -82,6 +82,15 @@ MATOMO_HOST="matomo.example.org"
|
|||
MAILJET_API_KEY=""
|
||||
MAILJET_SECRET_KEY=""
|
||||
|
||||
# Classic SMTP
|
||||
CLASSIC_SMTP_ENABLED="disabled"
|
||||
SMTP_HOST=""
|
||||
SMTP_PORT=""
|
||||
SMTP_USER=""
|
||||
SMTP_PASS=""
|
||||
SMTP_TLS=""
|
||||
SMTP_AUTHENTICATION="plain"
|
||||
|
||||
# Alternate SMTP Provider: SendInBlue/DoList
|
||||
SENDINBLUE_CLIENT_KEY=""
|
||||
SENDINBLUE_SMTP_KEY=""
|
||||
|
|
|
@ -77,6 +77,17 @@ Rails.application.configure do
|
|||
config.action_mailer.delivery_method = :mailtrap
|
||||
elsif ENV['MAILCATCHER_ENABLED'] == 'enabled'
|
||||
config.action_mailer.delivery_method = :mailcatcher
|
||||
elsif ENV['CLASSIC_SMTP_ENABLED'] == 'enabled'
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.smtp_settings = {
|
||||
address: ENV.fetch("SMTP_HOST"),
|
||||
port: ENV.fetch("SMTP_PORT"),
|
||||
domain: ENV.fetch("SMTP_HOST"),
|
||||
user_name: ENV.fetch("SMTP_USER"),
|
||||
password: ENV.fetch("SMTP_PASS"),
|
||||
authentication: ENV.fetch("SMTP_AUTHENTICATION"),
|
||||
enable_starttls_auto: ENV.fetch("SMTP_TLS").present?
|
||||
}
|
||||
else
|
||||
sendinblue_weigth = ENV.fetch('SENDINBLUE_BALANCING_VALUE') { 0 }.to_i
|
||||
dolist_weigth = ENV.fetch('DOLIST_BALANCING_VALUE') { 0 }.to_i
|
||||
|
|
Loading…
Reference in a new issue