[deploy] Update Sendgrid to Use API Key if Present (#9981)
This commit is contained in:
parent
513717e680
commit
00ad509c3a
1 changed files with 3 additions and 2 deletions
|
|
@ -115,13 +115,14 @@ Rails.application.configure do
|
|||
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.perform_deliveries = true
|
||||
sendgrid_api_key_present = ENV["SENDGRID_API_KEY"].present?
|
||||
config.action_mailer.default_url_options = { host: protocol + config.app_domain }
|
||||
ActionMailer::Base.smtp_settings = {
|
||||
address: "smtp.sendgrid.net",
|
||||
port: "587",
|
||||
authentication: :plain,
|
||||
user_name: ENV["SENDGRID_USERNAME_ACCEL"],
|
||||
password: ENV["SENDGRID_PASSWORD_ACCEL"],
|
||||
user_name: sendgrid_api_key_present ? "apikey" : ENV["SENDGRID_USERNAME_ACCEL"],
|
||||
password: sendgrid_api_key_present ? ENV["SENDGRID_API_KEY"] : ENV["SENDGRID_PASSWORD_ACCEL"],
|
||||
domain: ENV["APP_DOMAIN"],
|
||||
enable_starttls_auto: true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue