ryanb/letter_opener — Issue #25: non-rails ActionMailer setup
Author: jjb
Created: 2012-01-03 00:25:46+00:00
State: open

Here's how I got it working with ActionMailer on a non-rails project. Could perhaps go in the Readme.

```ruby
# Gemfile
gem 'letter_opener', :group => :development

# wherever...
require "letter_opener"

ActionMailer::Base.add_delivery_method :letter_opener, LetterOpener::DeliveryMethod,
:location => APP_ROOT + "tmp/letter_opener"

ActionMailer::Base.delivery_method = :normal_method
ActionMailer::Base.delivery_method = :letter_opener if ENVIRONMENT == 'development'
```