Skip to content

Intercept recipients when delivering email with the Mail gem.

License

Notifications You must be signed in to change notification settings

D3MNetworks/recipient_interceptor

 
 

Repository files navigation

RecipientInterceptor

Build Status

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]',
  ),
)

About

Intercept recipients when delivering email with the Mail gem.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%