Created
November 24, 2010 09:50
-
-
Save laurynas/713416 to your computer and use it in GitHub Desktop.
Add option to deliver all mails to one address. Useful in staging environment.
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
# Add option to deliver all mails to one address. Useful in staging environment. | |
# config.action_mailer.delivery_method = :catchall | |
module ActionMailer | |
class Base | |
def perform_delivery_catchall(mail) | |
original_to = mail.to | |
mail.to = "youremail@yourdomain" | |
mail.cc = "" | |
mail.bcc = "" | |
mail.subject = "#{mail.subject} / Original To: #{original_to}" | |
Rails.logger.info "Mail delivery catchall: #{original_to} => #{mail.to}" | |
perform_delivery_sendmail(mail) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment