Skip to content

Instantly share code, notes, and snippets.

@adamrobbie
Created November 15, 2012 11:57
Show Gist options
  • Save adamrobbie/4078295 to your computer and use it in GitHub Desktop.
Save adamrobbie/4078295 to your computer and use it in GitHub Desktop.
ActionMailer hook to intercept all outgoing development email
# Place me in config/application.rb or in your development file
if Rails.env.development?
class Hook
def self.delivering_email(message)
message.to = "\"#{message.to.first}\" <[email protected]>"
message.cc = nil if !message.cc.nil?
message.bcc = nil if !message.bcc.nil?
end
end
ActionMailer::Base.register_interceptor(Hook)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment