chore: Fix "action_mailer.delivery_method" in the test env (#4257)

Fixes: #4247
This commit is contained in:
Jordan Brough 2022-03-23 09:16:28 -06:00 committed by GitHub
parent 160e8a8ab4
commit b735135431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,6 @@ Rails.application.configure do
# Configuration Related to Action Mailer
#########################################
config.action_mailer.delivery_method = :smtp
# We need the application frontend url to be used in our emails
config.action_mailer.default_url_options = { host: ENV['FRONTEND_URL'] } if ENV['FRONTEND_URL'].present?
# We load certain mailer templates from our database. This ensures changes to it is reflected immediately
@ -26,7 +25,7 @@ Rails.application.configure do
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']
config.action_mailer.delivery_method = :smtp
config.action_mailer.delivery_method = :smtp unless Rails.env.test?
config.action_mailer.smtp_settings = smtp_settings
# You can use letter opener for your local development by setting the environment variable
config.action_mailer.delivery_method = :letter_opener if Rails.env.development? && ENV['LETTER_OPENER']