Skip to content

Instantly share code, notes, and snippets.

@tute
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tute/6c8677df1b3e2901c1f8 to your computer and use it in GitHub Desktop.
Save tute/6c8677df1b3e2901c1f8 to your computer and use it in GitHub Desktop.
config/initializers/email_interceptor.rb
class NonProductionMailInterceptor
def self.delivering_email(message)
message.subject = "#{message.to}: #{message.subject}"
message.to = 'ourselves+test@gmail.com, ourselves+test@gmail.com'
message.cc = nil
message.bcc = nil
end
end
unless Rails.env.production?
ActionMailer::Base.register_interceptor(NonProductionMailInterceptor)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment