-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
185 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
root: ./docs/ | ||
structure: | ||
readme: ./../README.md | ||
summary: ./SUMMARY.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,22 @@ an email driver for your local or staging environment, you can inspect emails wi | |
* Packed with a simple Blade UI and a Vue.js/JSON controller | ||
* Easily integrate in your existing application | ||
|
||
## Usage | ||
|
||
Outgoing emails will be automatically copied to a local disk or table, but you can work with this package manually as well with the Emails facade: | ||
|
||
```php | ||
<?php | ||
use Axyr\EmailViewer\Facades\Emails; | ||
|
||
Emails::create($mimeMessage); | ||
Emails::find($fileNameOrId); | ||
Emails::delete($fileNameOrId); | ||
Emails::paginate(10); | ||
Emails::prune(); | ||
Emails::server('database')->get(); | ||
``` | ||
|
||
## Quick start | ||
|
||
Run the composer install command from the terminal: | ||
|
@@ -29,7 +45,7 @@ composer require axyr/laravel-email-viewer | |
Publish the database migration and configuration file: | ||
|
||
```php | ||
php artisan vendor:publish --provider="Axyr\EmailViewer\EmailViewerServiceProvider" | ||
php artisan vendor:publish --provider="Axyr\EmailViewer\EmailViewerServiceProvider" | ||
``` | ||
|
||
By default the package provides a set of routes for the Blade UI and the Vue UI. You can disabled them in the config file. | ||
|
@@ -40,10 +56,11 @@ You can access the Blade UI by visiting: | |
https://your-host.tld/emails | ||
``` | ||
|
||
To send a test email the package provides a Test command: | ||
To send a test email the package provides a simple Test command. | ||
By default it will send to the laraval config value `mail.from.address` | ||
|
||
```php | ||
php artisan email-viewer:send-test | ||
php artisan email-viewer:send-test [email protected] [email protected] | ||
``` | ||
|
||
For further information and customisation, visit our documentation page: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,67 @@ | ||
# Configuration | ||
|
||
```php | ||
<?php | ||
|
||
return [ | ||
/* | ||
* This option defines the default storage method. | ||
* You can choose between one of the Laravel | ||
* filesystem disks or a database table. | ||
*/ | ||
'default' => env('EMAIL_VIEWER_DEFAULT', 'disk'), | ||
|
||
/* | ||
* When this option is set to false, the package will not copy any emails. | ||
*/ | ||
'enabled' => (bool)env('EMAIL_VIEWER_ENABLED', true), | ||
|
||
/* | ||
* The PhpMimeMailParser uses the pecl mailparse extension. | ||
* Replace this class if you want to use a customer mail parser. | ||
*/ | ||
'parser' => \Axyr\EmailViewer\Parsers\PhpMimeMailParser::class, | ||
|
||
/* | ||
* The EmailWriterListener listens to the MessageSending event | ||
* and copies the email to the default storage. | ||
*/ | ||
'listener' => \Axyr\EmailViewer\Listeners\EmailWriterListener::class, | ||
|
||
/* | ||
* Disable this setting, if you don't want to use the default routes | ||
* and instead use your own route setup. | ||
*/ | ||
'routes-enabled' => true, | ||
|
||
/* | ||
* If you do want to use the default routes, | ||
* but want a different prefix, you can adjust this value. | ||
*/ | ||
'route-prefix' => 'emails', | ||
|
||
/* | ||
* The package controllers default items per page for the pagination results. | ||
* If you want to use the shipped controllers, but a different default items per page, | ||
* change this value. | ||
*/ | ||
'default_pagination' => 25, | ||
|
||
/* | ||
* The possible 'servers' where you can store a copy of all the outgoing emails. | ||
* You can swap out the model and repository classes with your own implementations. | ||
*/ | ||
'servers' => [ | ||
'disk' => [ | ||
'disk_name' => env('EMAIL_VIEWER_DISK', env('FILESYSTEM_DISK', 'local')), | ||
'model' => \Axyr\EmailViewer\Servers\Disk\Email::class, | ||
'repository' => \Axyr\EmailViewer\Servers\Disk\Repository::class, | ||
], | ||
'database' => [ | ||
'table_name' => 'email_viewer_emails', | ||
'model' => \Axyr\EmailViewer\Servers\Database\Email::class, | ||
'repository' => \Axyr\EmailViewer\Servers\Database\Repository::class, | ||
], | ||
], | ||
]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
# Installation | ||
|
||
Run the composer install command from the terminal: | ||
|
||
```php | ||
composer require axyr/laravel-email-viewer | ||
``` | ||
|
||
Publish the database migration and configuration file: | ||
|
||
```php | ||
php artisan vendor:publish --provider="Axyr\EmailViewer\EmailViewerServiceProvider" | ||
``` | ||
|
||
By default the package provides a set of routes for the Blade UI and the Vue UI. You can disabled them in the config file. | ||
|
||
You can access the Blade UI by visiting: | ||
|
||
``` | ||
https://your-host.tld/emails | ||
``` | ||
|
||
To send a test email the package provides a simple Test command. | ||
By default it will send to the laraval config value `mail.from.address` | ||
|
||
```php | ||
php artisan email-viewer:send-test [email protected] [email protected] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 📨 Laravel Email Viewer | ||
|
||
View and inspect all emails sent from your Laravel application. | ||
|
||
![](docs/img/mailboxes.png) | ||
|
||
Laravel Email Viewer is a package that allows you to view all emails sent from you application in the browser. This allows you to ensure your application has actually sent the mail. When using log as | ||
an email driver for your local or staging environment, you can inspect emails without the need for external tools like Mailtrap or Mailhog, so emails never have to leave your server at all. | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/axyr/laravel-email-viewer.svg?style=flat-square)](https://packagist.org/packages/axyr/laravel-email-viewer) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-permission/run-tests-L8.yml?branch=main\&label=Tests)](https://github.com/axyr/laravel-email-viewer/actions?query=workflow%3ATests+branch%3Amain) | ||
|
||
## Key features | ||
|
||
* Log all application emails to a storage disk or database table | ||
* Inspect HTML, attachments and email headers | ||
* Packed with a simple Blade UI and a Vue.js/JSON controller | ||
* Easily integrate in your existing application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Requirements | ||
|
||
mailparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters