Thanks to visit codestin.com
Credit goes to github.com

Skip to content

excid3/mailbin

Repository files navigation

📬 Mailbin

Preview emails sent from ActionMailer in the browser.

Mailbin writes emails to tmp/mailbin for easy access and testing.

📦 Installation

Add Mailbin to your Gemfile:

bundle add "mailbin"

Configure Rails to send emails to Mailbin:

# config/environments/development.rb
config.action_mailer.delivery_method = :mailbin
config.action_mailer.perform_deliveries = true

Add the routes to view emails with MailBin:

Rails.application.routes.draw do
  mount Mailbin::Engine => :mailbin if Rails.env.development?
end

Usage

Open http://localhost:3000/mailbin to view your emails in development.

Storage Loaction

Mailbin stores emails in tmp/mailbin by default. To change this, you can set the storage_location config.

# config/initializers/mailbin.rb
Mailbin.storage_location = ENV["MAILBIN_STORAGE_LOCATION"] || Rails.root.join("tmp", "mailbin-#{Rails.env}")

Authentication

If you're using Mailbin outside of development, you can override Mailbin::ApplicationController to add authentication.

class Mailbin::ApplicationController < ActionController::Base
  # Add authentication here
end

Contributing

If you have an issue you'd like to submit, please do so using the issue tracker in GitHub. In order for us to help you in the best way possible, please be as detailed as you can.

If you'd like to open a PR please make sure the following things pass:

bin/rails db:test:prepare
bin/rails test
bin/rubocop -A

License

The gem is available as open source under the terms of the MIT License.

About

Record and view Rails ActionMailer emails sent in development

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 7