Skip to content
Intercept recipients when delivering email with the Mail gem.
Branch: master
Clone or download
Latest commit e5342f5 May 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
recipient_interceptor.gemspec

README.md

RecipientInterceptor

Never accidentally send emails to real people from your staging environment.

Rails example

Send all staging emails to a group email address without accidentally emailing users with active email addresses in the database.

In Gemfile:

gem 'recipient_interceptor'

In config/environments/staging.rb:

Mail.register_interceptor RecipientInterceptor.new(ENV['EMAIL_RECIPIENTS'])

From the command line:

heroku config:add EMAIL_RECIPIENTS="staging@example.com" --remote staging

Options

Optionally prefix the subject line:

Mail.register_interceptor(
  RecipientInterceptor.new(
    ENV['EMAIL_RECIPIENTS'],
    subject_prefix: '[STAGING]',
  ),
)

Contributing

Fork the repo. Run tests with rake. Make a change. Run tests. Open a pull request. Discuss/address any feedback with maintainer. Maintainer will merge.

You can’t perform that action at this time.