Fixed configuration rake task check (#1155)

Co-authored-by: Jesus Federico <jesus@123it.ca>
This commit is contained in:
Ahmad Farhat 2020-04-01 17:28:46 -04:00 committed by GitHub
parent 509215ae8d
commit 11cdd1ec14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -44,8 +44,11 @@ def test_smtp
smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)
end
smtp.start(ENV['SMTP_DOMAIN'], ENV['SMTP_USERNAME'], ENV['SMTP_PASSWORD'],
ENV['SMTP_AUTH']) do |s|
user = ENV['SMTP_USERNAME'].presence || nil
password = ENV['SMTP_PASSWORD'].presence || nil
authtype = ENV['SMTP_AUTH'].present? && ENV['SMTP_AUTH'] != "none" ? ENV['SMTP_AUTH'] : nil
smtp.start(ENV['SMTP_DOMAIN'], user, password, authtype) do |s|
s.sendmail('test', ENV['SMTP_USERNAME'], 'notifications@example.com')
end
rescue => e