A basic Mail interceptor gem for (Rails 3) development and other environments.
Ruby JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.document
.gitignore
.rvmrc
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
VERSION
mail_envi.gemspec

README.md

MailEnvi

A basic Mail interceptor gem for (Rails 3) development and other environments.

Basic Usage

Install

gem "mail_envi"

That is about it.

While, you can configure the MailEnvi to work within any environment. For most basic uses, I recommend you keep this gem under your development group in your Gemfile.


Intercepted mail will, by default, change the to address to root@localhost and will prefix the subject to identify it was intercepted.

Ex:

# original mail
to: foo@bar.com
subject: Hello World

# intercepted mail
to: root@localhost
subject: (#{Rails.env} Intercepted) Hello World

Configuration

There are a few configuration options you can provide to extend/customize the functionality of MailEnvi.

In your initializer/mail_envi.rb

MailEnvi::Config.set do |config|
  config.interceptor = CustomInterceptorClass
  config.default_to  = "person@company.com"
  config.include_environments [:beta, :alpha]
end
key accepted value description
interceptor Class You can provide a custom interceptor class to provide customized interception “your way”.
default_to String Replace the DefaultInterceptor’s to address, to one set in the config. Only works through the DefaultInterceptor
include_environments Array Adds the array, to the list of included environments that should register the interceptor

Inspirations

TODO

  • Test helpers
  • Multi-environment configurations

Contributing to mail_envi

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2011 Yung Hwa Kwon. See LICENSE.txt for further details.