recipient_interceptor

by croaky

Intercept recipients when delivering email with the Mail gem.

215 Stars 17 Forks Last release: Not found MIT License 28 Commits 1 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

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="[email protected]" --remote staging

Options

Optionally prefix the subject line:

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

Contributing

Fork the repo.

bundle
rake

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.