Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created September 9, 2009 23:24
Show Gist options
  • Save edavis10/184168 to your computer and use it in GitHub Desktop.
Save edavis10/184168 to your computer and use it in GitHub Desktop.
Patch TMail/ActionMailer to deliver all email to one address in staging
# Send all mail to a single address in staging
if RAILS_ENV == 'staging'
STAGING_EMAIL_ADDRESS = '[email protected]'
module TMail
class Mail
def destinations
[STAGING_EMAIL_ADDRESS]
end
def to=( *strs )
set_string_array_attr 'To', [STAGING_EMAIL_ADDRESS]
end
def cc=( *strs )
set_string_array_attr 'To', [STAGING_EMAIL_ADDRESS]
end
def bcc=( *strs )
set_string_array_attr 'To', [STAGING_EMAIL_ADDRESS]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment