Created
May 31, 2012 10:09
-
-
Save mpouleijn/2842408 to your computer and use it in GitHub Desktop.
Mail 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
# Register the interceptor for a environment | |
# | |
require "mail_interceptor" | |
AppName::Application.configure do | |
#... | |
config.action_mailer.register_interceptor(MailInterceptor) | |
end |
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
# This file can be placed in the /lib folder | |
# | |
# Class will over write the subject and receivers information, | |
# register this interceptor in each environment you don't want | |
# to send emails to your customers | |
# | |
class MailInterceptor | |
def self.delivering_email(message) | |
message.subject = "#{message.to} #{message.subject}" | |
message.to = "info@example.com" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment