diff --git a/rails/config/initializers/sandbox_email_interceptor.rb b/rails/config/initializers/sandbox_email_interceptor.rb new file mode 100644 index 00000000..56f5ae32 --- /dev/null +++ b/rails/config/initializers/sandbox_email_interceptor.rb @@ -0,0 +1,9 @@ +class SandboxEmailInterceptor + def self.delivering_email(message) + message.to = ['digitalservices@mapc.org'] + end +end + +if Rails.env.staging? || Rails.env.development? + ActionMailer::Base.register_interceptor(SandboxEmailInterceptor) +end