Created
November 15, 2012 11:57
-
-
Save adamrobbie/4078295 to your computer and use it in GitHub Desktop.
ActionMailer hook to intercept all outgoing development email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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