From 6c70044a7f09852ede39142b2ce0712a5cb8c0db Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 18 Jan 2019 14:13:11 +1300 Subject: [PATCH 1/3] Switch to SendGrid (remove sparkhost) --- Gemfile | 1 - Gemfile.lock | 3 --- app.json | 2 +- config/application.yml.example | 3 --- config/environments/production.rb | 13 +++++++------ 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index c0cd21aa5..d52faad1c 100644 --- a/Gemfile +++ b/Gemfile @@ -109,7 +109,6 @@ group :production, :staging do gem 'memcachier' gem 'newrelic_rpm' gem 'rails_12factor' # supresses heroku plugin injection - gem 'sparkpost_rails' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 66fc03724..2695da455 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -459,8 +459,6 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - sparkpost_rails (1.5.1) - rails (>= 4.0, < 5.3) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -584,7 +582,6 @@ DEPENDENCIES sass-rails selenium-webdriver sidekiq - sparkpost_rails timecop uglifier unicorn diff --git a/app.json b/app.json index fc266aded..051e2bbf9 100644 --- a/app.json +++ b/app.json @@ -41,7 +41,7 @@ "bonsai-elasticsearch", "memcachier", "newrelic", - "sparkhost" + "sendgrid" ], "buildpacks": [ { diff --git a/config/application.yml.example b/config/application.yml.example index 1ff6b5f99..e0f0f67d2 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -81,7 +81,6 @@ GROWSTUFF_EMAIL: 'noreply@dev.growstuff.org' test: GROWSTUFF_SITE_NAME: Growstuff (test) GROWSTUFF_CAPYBARA_DRIVER: poltergeist - GROWSTUFF_EMAIL: 'noreply@test.growstuff.org' # Note: there is no good way to deploy settings from Figaro to # Travis-CI. If you need env vars set there in order for tests to pass, @@ -90,9 +89,7 @@ test: staging: GROWSTUFF_SITE_NAME: Growstuff (staging) GROWSTUFF_ELASTICSEARCH: "true" - GROWSTUFF_EMAIL: 'noreply@staging.growstuff.org' production: GROWSTUFF_SITE_NAME: Growstuff GROWSTUFF_ELASTICSEARCH: "true" - GROWSTUFF_EMAIL: 'noreply@growstuff.org' diff --git a/config/environments/production.rb b/config/environments/production.rb index b9ab1a14e..9175f85f1 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -82,12 +82,13 @@ Rails.application.configure do # Growstuff configuration config.action_mailer.default_url_options = { host: ENV['MAIL_SENDER_HOST'] } - ActionMailer::Base.smtp_settings = { - port: ENV['SPARKPOST_SMTP_PORT'], - address: ENV['SPARKPOST_SMTP_HOST'], - user_name: ENV['SPARKPOST_SMTP_USERNAME'], - password: ENV['SPARKPOST_SMTP_PASSWORD'], - authentication: :login, + config.action_mailer.smtp_settings = { + user_name: ENV['SENDGRID_USERNAME'], + password: ENV['SENDGRID_PASSWORD'], + domain: ENV['GROWSTUFF_EMAIL_DOMAIN'], + address: 'smtp.sendgrid.net', + port: 587, + authentication: :plain, enable_starttls_auto: true } ActionMailer::Base.delivery_method = :smtp From 03c8d75899983eb73428484f0f8d7bcb95ac7c68 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 18 Jan 2019 14:48:04 +1300 Subject: [PATCH 2/3] Fixing the app.json for Bonsai --- app.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app.json b/app.json index fc266aded..2d9096437 100644 --- a/app.json +++ b/app.json @@ -38,10 +38,15 @@ }, "addons": [ "heroku-postgresql", - "bonsai-elasticsearch", "memcachier", "newrelic", - "sparkhost" + "sparkhost", + { + "plan": "bonsai:sandbox-6", + "options": { + "version": "6.2.3" + } + } ], "buildpacks": [ { From 1fc70e5a2b3eb1d6f7969cdab10c5d2f6cdebcf7 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 18 Jan 2019 14:54:24 +1300 Subject: [PATCH 3/3] Rubocop linting --- config/environments/production.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 464bef857..d4f2bcddf 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -83,12 +83,12 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: ENV['MAIL_SENDER_HOST'] } config.action_mailer.smtp_settings = { - user_name: ENV['SENDGRID_USERNAME'], - password: ENV['SENDGRID_PASSWORD'], - domain: ENV['GROWSTUFF_EMAIL_DOMAIN'], - address: 'smtp.sendgrid.net', - port: 587, - authentication: :plain, + user_name: ENV['SENDGRID_USERNAME'], + password: ENV['SENDGRID_PASSWORD'], + domain: ENV['GROWSTUFF_EMAIL_DOMAIN'], + address: 'smtp.sendgrid.net', + port: 587, + authentication: :plain, enable_starttls_auto: true } ActionMailer::Base.delivery_method = :smtp