From 02524e86b2c532c0e7904f524c70d2f9f4985ff2 Mon Sep 17 00:00:00 2001
From: Tijmen Brommet <tijmen@gmail.com>
Date: Wed, 9 Mar 2016 13:28:24 +0000
Subject: [PATCH] Remove ActionMailer

This application does not send emails. Presumably the action_mailer
framework with SES config was added to support error notification (we
used to use a email-based thing, but that has all been replaced by
Errbit/Airbrake).

This will speed up the load time for the app slightly.
---
 config/application.rb             | 1 -
 config/environments/production.rb | 6 ------
 config/environments/test.rb       | 5 -----
 3 files changed, 12 deletions(-)

diff --git a/config/application.rb b/config/application.rb
index 5f78262ff7..805bd15cb6 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,7 +1,6 @@
 require File.expand_path('../boot', __FILE__)
 
 require "action_controller/railtie"
-require "action_mailer/railtie"
 require "rails/test_unit/railtie"
 require "sprockets/railtie"
 
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 3b2c2fb6fd..32171afd84 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -37,9 +37,6 @@
   # In production, Apache or nginx will already do this
   config.serve_static_files = false
 
-  # Disable delivery errors, bad email addresses will be ignored
-  # config.action_mailer.raise_delivery_errors = false
-
   # Enable threaded mode
   # config.threadsafe!
 
@@ -56,9 +53,6 @@
   config.slimmer.use_cache = true
   config.slimmer.asset_host = Plek.current.find('static')
 
-  config.action_mailer.default_url_options = { :host => Plek.current.find('frontend') }
-  config.action_mailer.delivery_method = :ses
-
   # Enable JSON-style logging
   config.logstasher.enabled = true
   config.logstasher.logger = Logger.new("#{Rails.root}/log/#{Rails.env}.json.log")
diff --git a/config/environments/test.rb b/config/environments/test.rb
index afd98d85ac..c766b4cd8a 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -20,11 +20,6 @@
   # Disable request forgery protection in test environment
   config.action_controller.allow_forgery_protection    = false
 
-  # Tell Action Mailer not to deliver emails to the real world.
-  # The :test delivery method accumulates sent emails in the
-  # ActionMailer::Base.deliveries array.
-  config.action_mailer.delivery_method = :test
-
   # Use SQL instead of Active Record's schema dumper when creating the test database.
   # This is necessary if your schema can't be completely dumped by the schema dumper,
   # like if you have constraints or database-specific column types