Take a look at How to intercept ActionMailer messages on rails 3? . You will need to add message.to = my@email, and mail will be sent to your email address instead of the original recipient.
This is what I ended up with a post related to above:
if Rails.env.development?
class Hook
def self.delivering_email(message)
message.to = "\"#{message.to.first}\" <my@email.com>"
message.cc = nil if !message.cc.nil?
message.bcc = nil if !message.bcc.nil?
end
end
ActionMailer::Base.register_interceptor(Hook)
end
eugen source
share