Skip to content

Instantly share code, notes, and snippets.

@tute
Last active August 29, 2015 14:02
Show Gist options
  • 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 = '[email protected], [email protected]'
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