Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MailsViewer is a Rails engine to let you easily view and send mails in non-production environment.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Octocat-spinner-32 app Fix: Error raised when to/cc/from are string's and not arrays [issue#7] November 28, 2013
Octocat-spinner-32 config refactor the view September 02, 2012
Octocat-spinner-32 lib release v0.1.2. November 29, 2013
Octocat-spinner-32 spec bump up with 0.1.0. March 21, 2013
Octocat-spinner-32 .gitignore Spec that cover mail files creation September 14, 2011
Octocat-spinner-32 Gemfile more specs September 18, 2011
Octocat-spinner-32 Gemfile.lock release v0.1.2. November 29, 2013
Octocat-spinner-32 Guardfile more specs September 18, 2011
Octocat-spinner-32 LICENSE refactor the view September 02, 2012
Octocat-spinner-32 README.md Updated logo url. February 21, 2014
Octocat-spinner-32 Rakefile Add specs September 14, 2011
Octocat-spinner-32 mails_viewer.gemspec bump up with 0.1.0. March 21, 2013
README.md

MailsViewer

MailsViewer is a mails preview Engine which provides a table view for all mails under tmp/mails. So you can easily preview the mails in non-production mode and no longer need to worry about accidentally sending a test email to someone else’s address.

MailsViewer is a fork of tomlion's original code and I'm glad to be the maintainer; thanks go to him for getting this thing started!

REQUIREMENT

  • MailsViewer should be used with Rails >= 3.1

  • In your config file, You should require "sprockets/railtie"if you don't require 'rails/all' and enable assets pipeline by adding config.assets.enabled = true to config file

Usage

Add the gem to your Gemfile :

gem "mails_viewer"

Set ActionMailer's delivery method to :file :

config.action_mailer.delivery_method = :file

put this in your routes.rb:

mount MailsViewer::Engine => '/delivered_mails'

Now just load up http://localhost:3000/delivered_mails

Advanced

You can choose to send out some mails to the inbox instead of just storing them in the file system by specifying which mails to sent:

  • : send_if - Send mails that satisfy some condition
config.action_mailer.delivery_method = :file
config.action_mailer.file_settings = {
  location: 'tmp/mails',
  smtp_settings: {
    address:              "localhost",
    port:                 25,
    domain:               'localhost.localdomain',
    user_name:            nil,
    password:             nil,
    authentication:       nil,
    enable_starttls_auto: true
  },
  send_if: lambda { |mail| mail.destinations.select { |address| ["yedingding@gmail.com"].include?(address) }.any? }
}

Now any mails sent to yedingding@gmail.com will not only store in the filesystem for you to browse later, but also send out to his inbox.

Credits

风车协作

MailsViewer is maintained by Fengche.co (Originally Pragmatic.ly).

Special thanks to tomlion for starting the project.

Copyright (c) 2012 Dingding Ye, Fengche.co (dingding@fengche.co, https://fengche.co/)

Something went wrong with that request. Please try again.