Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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