Created
April 29, 2010 06:28
-
-
Save nikz/383227 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| module ActionMailer | |
| class Base | |
| def deliver_with_noob_protection!(mail = @mail) | |
| [:to, :cc, :bcc].each do |recipient_group| | |
| old_emails = mail.send(recipient_group) | |
| unless old_emails.nil? | |
| # clear out the old | |
| mail.send("#{recipient_group}=", []) | |
| # add in new, protected emails | |
| mail.send("#{recipient_group}=", old_emails.map { |em| "team+#{em.gsub("@", "-")}@minutedock.com" }) | |
| end | |
| end | |
| deliver_without_noob_protection!(mail) | |
| end | |
| alias_method_chain :deliver!, :noob_protection | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment