Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created July 5, 2011 12:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgun/1064756 to your computer and use it in GitHub Desktop.
Save ozgun/1064756 to your computer and use it in GitHub Desktop.
Monkeypatch ActionMailer's recipients
# config/initializers/action_mailer_ext.rb
# For Rails 2.x
if Rails.env.staging?
class ActionMailer::Base
def recipients(*params)
@recipients = "staging@example.com"
end
def bcc(*params)
@bcc = nil
end
def cc(*params)
@cc = nil
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment