Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mailtrapper

This is a package for Laravel and Vue that captures emails generated by the framework and renders them into an onscreen email viewer.

Think Mailtrap, but inline within the application itself, with no need to login to a separate service.

What it does

Overrides the default mail transport in Laravel to save rendered emails to a database table.

The Recipient, Subject and HTML body are all captured.

The Vue component adds a mail icon at the top right, polls every few seconds for recent messages, and flashes when a new message is available.

Clicking on the icon opens an onscreen inbox. Because all emails are captured, this includes all emails generated to any recipient.

Requirements for use

  • Laravel 9+
  • Vue 3+
  • axios
  • A logged in user accessible at auth()->user() [DEFAULT]

Authentication

By default the library requires an authenticated user and uses the web middleware group. You can customise this by publishing the config and modifying the middleware to suit your needs.

Installation

composer require actinity/mailtrapper

Import the component from vendor/actinity/mailtrapper/src/components/Mailtrapper.vue

Add the <mailtrapper></mailtrapper> tag to a view or your main SPA component.

Run php artisan migrate to set up the table

Set MAIL_MAILER=trapper in your .env

Emptying the database

If you define a gate called mailtrapper:empty, the interface will include an 'Empty' button for matching users that allows them to empty the shared mailbox.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages