Skip to content

Instantly share code, notes, and snippets.

@laurynas
Created November 24, 2010 09:50
Show Gist options
  • Save laurynas/713416 to your computer and use it in GitHub Desktop.
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.
# 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