Skip to content

Instantly share code, notes, and snippets.

@sdickey
Created June 10, 2014 04:33
Show Gist options
  • Select an option

  • Save sdickey/401d26cefec4054ced63 to your computer and use it in GitHub Desktop.

Select an option

Save sdickey/401d26cefec4054ced63 to your computer and use it in GitHub Desktop.

What is letter_opener?

A gem that allows you to preview emails in the browser instead of sending them. This is ideal for testing email delivery in your development environment, eliminating (or at least significantly reducing) the possibility of accidentally sending a test email to a live email address.

Installation instructions

Add the gem to your development environment:

gem "letter_opener", :group => :development

Set the delivery method in config/environments/development.rb

config.action_mailer.delivery_method = :letter_opener

Add the letter_opener gem to your gemfile and bundle install.

Now any emails sent in your development environment in rails will pop up in your browser instead of being delivered to the actual email address specified. The messages are stored in tmp/letter_opener.

Pretty simple gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment