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

Contributing to mail_envi

Copyright © 2011 Yung Hwa Kwon. See LICENSE.txt for further details.