Never accidentally send emails to real people from your staging environment.
Send all staging emails to a group email address without accidentally emailing users with active email addresses in the database.
Gemfile
:
gem 'recipient_interceptor'
config/environments/staging.rb
:
Mail.register_interceptor RecipientInterceptor.new(ENV['EMAIL_RECIPIENTS'])
Command line:
heroku config:add EMAIL_RECIPIENTS="staging@example.com" --remote staging
recipient_interceptor is maintained by Dan Croak and contributors like you.
RecipientInterceptor is © 2013 Dan Croak. It is free software, and may be
redistributed under the terms specified in the LICENSE
file.