Created
April 20, 2012 16:34
-
-
Save devton/2430160 to your computer and use it in GitHub Desktop.
Mailer interceptor
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
#config/initializers/interceptor.rb | |
require "#{Rails.root}/lib/development_mail_interceptor" | |
ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development? | |
#lib/development_mail_interceptor.rb | |
class DevelopmentMailInterceptor | |
def self.delivering_email(message) | |
message.subject = "[#{message.to}] #{message.subject}" | |
message.to = `git config --global user.email`.strip | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment