Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
Making the exception notifiers use the same email list from the confi…
Browse files Browse the repository at this point in the history
…g (prod/demo)
  • Loading branch information
sfisher committed Sep 20, 2017
1 parent 43b80d6 commit 8ec5dc9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
18 changes: 11 additions & 7 deletions config/environments/demo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,17 @@
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
# :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
:email_prefix => "[Dash2 Exception]",
:sender_address => %{"Dash2 Notifier" <no-reply-dash2-stg@ucop.edu>},
:exception_recipients => %w{marisa.strong@ucop.edu scott.fisher@ucop.edu bhavi.vedula@ucop.edu}
}
#this is obnovious because the initializers haven't run yet, so have to duplicate code to read config
ac = YAML.load_file(File.join(Rails.root, 'config', 'app_config.yml'))[Rails.env]
unless ac['support_team_email'].blank?
Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
# :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
:email_prefix => "[Dash Exception]",
:sender_address => %{"Dash Notifier" <no-reply-dash2@ucop.edu>},
:exception_recipients => ac['support_team_email']
}
end

config.action_mailer.delivery_method = :sendmail
config.action_mailer.perform_deliveries = true
Expand Down
21 changes: 12 additions & 9 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
config.eager_load = true

# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Enable Rack::Cache to put a simple HTTP cache in front of your application
Expand Down Expand Up @@ -80,14 +80,17 @@
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Exception Notification settings in Production
Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
# :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
:email_prefix => "[Dash Exception]",
:sender_address => %{"Dash Notifier" <no-reply-dash2@ucop.edu>},
:exception_recipients => %w{marisa.strong@ucop.edu scott.fisher@ucop.edu bhavi.vedula@ucop.edu}
}
#this is obnovious because the initializers haven't run yet, so have to duplicate code to read config
ac = YAML.load_file(File.join(Rails.root, 'config', 'app_config.yml'))[Rails.env]
unless ac['support_team_email'].blank?
Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
# :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
:email_prefix => "[Dash Exception]",
:sender_address => %{"Dash Notifier" <no-reply-dash2@ucop.edu>},
:exception_recipients => ac['support_team_email']
}
end

config.action_mailer.delivery_method = :sendmail
config.action_mailer.perform_deliveries = true
Expand Down

0 comments on commit 8ec5dc9

Please sign in to comment.