From 6f6d0fe74c01d775995d43f82ddd2db176462cb4 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 10 Nov 2015 02:56:31 +0300 Subject: [PATCH] Use SendGrid for production --- config/environments/production.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index cfa02aba9..f1265039e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -64,7 +64,20 @@ Rails.application.configure do # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false config.action_mailer.default_url_options = { host: ENV["HOST_URL"] } - config.delivery_method = :sendmail + # ActionMailer Config + # Setup for production - deliveries, no errors raised + config.action_mailer.delivery_method = :smtp + config.action_mailer.perform_deliveries = true + config.action_mailer.raise_delivery_errors = false + config.action_mailer.default :charset => "utf-8" + config.action_mailer.smtp_settings = { + :address => 'smtp.sendgrid.net', + :port => '25', + :authentication => :plain, + :user_name => ENV['SENDGRID_USERNAME'], + :password => ENV['SENDGRID_PASSWORD'], + :domain => ENV['SENDGRID_DOMAIN'] + } # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found).