Skip to content

Commit

Permalink
Action mailer setup for production
Browse files Browse the repository at this point in the history
  • Loading branch information
forsbergplustwo committed Sep 21, 2023
1 parent 3a84315 commit 2cf5af7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gem "bootsnap", require: false
gem "sidekiq"
gem "rack-timeout", require: "rack/timeout/base"
gem "active_storage_validations"
gem "sendgrid-actionmailer"

# Frontend
gem "sprockets-rails"
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,17 @@ GEM
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
ruby_http_client (3.5.5)
rubyzip (2.3.2)
selenium-webdriver (4.10.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sendgrid-actionmailer (3.2.0)
mail (~> 2.7)
sendgrid-ruby (~> 6.4)
sendgrid-ruby (6.6.2)
ruby_http_client (~> 3.4)
sidekiq (7.1.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
Expand Down Expand Up @@ -398,6 +404,7 @@ DEPENDENCIES
rails (~> 7.0.5)
redis (~> 5.0)
selenium-webdriver
sendgrid-actionmailer
sidekiq
sprockets-rails
standard
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
default from: Rails.application.credentials[:action_mailer][:email_from_address]
layout "mailer"
end
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GsqPjlUTsl6KTkOggkhONn9csM9f0jGlX56uEgA+yfaPpYjiqL5tjT/LpAP+YVDU/3jHKZTDdpRpYz/NfKtbkovNdL05C5Aeh7Qlc2ajRr53/CCTog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fBw8/yVrPcPMwqazVJ50R3DK7pLX6qZiTEWViKZ9Ew+l2pUm0To8X/ZmT++8iqOgj4IAOLbpSXXiSrp1WKPpq2PQwHa6B9uZIw6f1NUOEP9lNIC08jBW+y+TZuecstqK--CxAz8DjUPAzKqGf1--asr5mlmkOFh3YML/RNsHBw==
7 changes: 6 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = {host: "partnermetrics.io"}
app.config.action_mailer.delivery_method = :sendgrid_actionmailer
app.config.action_mailer.sendgrid_actionmailer_settings = {
api_key: Rails.application.credentials[:sendgrid][:api_key],
raise_delivery_errors: true
}

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Expand Down

0 comments on commit 2cf5af7

Please sign in to comment.