Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

epigenesys/email-store

Repository files navigation

EmailStore

Intercepts emails and stores them for viewing in the browser

Installation

Add this line to your application's Gemfile:

gem "email_store", git: "[email protected]:epigenesys/email-store.git"

And then execute:

$ bundle

To restrict unauthorised access to the stored emails please mount the engine in:

config/routes.rb

appropriately using your specific restrictions:

authenticated :user, ->(user) { user.staff? } do
  mount EmailStore::Engine, at: "/email_store"
end

Register the email interceptor as required for your desired environments in:

config/initializers

like so:

if Rails.env.qa? || Rails.env.demo?
  ActionMailer::Base.register_interceptor(EmailStore::DeliveryInterceptor)
end

Run the install command to copy the migrations over to your app:

rails email_store:install:migrations

Run the migrations:

rails db:migrate SCOPE=email_store

Usage

Emails sent in QA and DEMO environment will be automatically intercepted and stored to be previewed at:

/email_store/emails

Warning

Performing deliveries with

deliver!

will bypass the email interception and cause the email to be delivered!

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published