Skip to content

Commit

Permalink
Add interceptor to Digital Services email for mailers on dev and staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Annabelle Thomas Taylor committed Nov 20, 2020
1 parent 817a272 commit 2c1d598
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rails/config/initializers/sandbox_email_interceptor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class SandboxEmailInterceptor
def self.delivering_email(message)
message.to = ['[email protected]']
end
end

if Rails.env.staging? || Rails.env.development?
ActionMailer::Base.register_interceptor(SandboxEmailInterceptor)
end

0 comments on commit 2c1d598

Please sign in to comment.