Created
February 1, 2015 18:49
-
-
Save ckib16/6b30e2493157f4391d36 to your computer and use it in GitHub Desktop.
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 interceptor just makes sure that local mail | |
# only emails you. | |
# http://edgeguides.rubyonrails.org/action_mailer_basics.html#intercepting-emails | |
class DevelopmentMailInterceptor | |
def self.delivering_email(message) | |
message.to = 'youremail@website.com' | |
message.cc = nil | |
message.bcc = nil | |
end | |
end | |
# Locally, outgoing mail will be 'intercepted' by the | |
# above DevelopmentMailInterceptor before going out | |
if Rails.env.development? | |
ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chris - what is the purpose of the interceptor code above? Is it mainly to test the email canbe sent out? I'm guessing the flow is: