From 40001037fd4cb7f2a0df1ca7b9f9a82c855166bc Mon Sep 17 00:00:00 2001 From: Sage Griffin Date: Tue, 5 Apr 2022 18:35:10 -0600 Subject: [PATCH 1/3] Fix email config --- config/environments/production.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index db88a7023..8b5a308a5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -88,12 +88,12 @@ config.action_mailer.default_options = {from: ENV['MAIL_FROM']} config.action_mailer.smtp_settings = { - :address => 'smtp.sendgrid.net', + :address => ENV['SENDGRID_ADDRESS'], :port => '587', :authentication => :plain, :user_name => "apikey", :password => ENV['SENDGRID_API_KEY'], - :domain => 'heroku.com', + :domain => ENV['SENDGRID_DOMAIN'], :enable_starttls_auto => true } From cb48717006d2fcd414b59fe528fcdfec9d36373f Mon Sep 17 00:00:00 2001 From: Sage Griffin Date: Tue, 5 Apr 2022 18:38:44 -0600 Subject: [PATCH 2/3] Error if sendgrid env not set --- config/environments/production.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 8b5a308a5..a3ceb802a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -88,12 +88,12 @@ config.action_mailer.default_options = {from: ENV['MAIL_FROM']} config.action_mailer.smtp_settings = { - :address => ENV['SENDGRID_ADDRESS'], + :address => ENV.fetch('SENDGRID_ADDRESS'), :port => '587', :authentication => :plain, :user_name => "apikey", - :password => ENV['SENDGRID_API_KEY'], - :domain => ENV['SENDGRID_DOMAIN'], + :password => ENV.fetch('SENDGRID_PASSWORD'), + :domain => ENV.fetch('SENDGRID_DOMAIN'), :enable_starttls_auto => true } From 3839bdf1c3673a7682bd9726308cabc6e8abdc6a Mon Sep 17 00:00:00 2001 From: Sage Griffin Date: Tue, 5 Apr 2022 18:42:29 -0600 Subject: [PATCH 3/3] Read email username env var --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index a3ceb802a..815489ccd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -91,7 +91,7 @@ :address => ENV.fetch('SENDGRID_ADDRESS'), :port => '587', :authentication => :plain, - :user_name => "apikey", + :user_name => ENV.fetch('SENDGRID_USERNAME'), :password => ENV.fetch('SENDGRID_PASSWORD'), :domain => ENV.fetch('SENDGRID_DOMAIN'), :enable_starttls_auto => true