Download the PHP package smajohusic/laravel-mail-logger without Composer
On this page you can find all versions of the php package smajohusic/laravel-mail-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smajohusic/laravel-mail-logger
More information about smajohusic/laravel-mail-logger
Files in smajohusic/laravel-mail-logger
Package laravel-mail-logger
Short Description Listens to Mail send event, and saves the information to database as backup/log
License MIT
Informations about the package laravel-mail-logger
Laravel Mail Logger
Introduction
Mail logger has one purpose, save mail before they are sent from your app. This enables you to have backup of mail and a overview if something goes wrong.
This package listens to the MessageSending event fired from Mailer. The listener will dispatch a job, then save the needed form information, event, route and recipient to the database.
This package also supports auto deleting. You can define how long the the app should keep the logs by defining days in the config file.
Installation
Laravel 5.5 +
-
composer require smajohusic/laravel-mail-logger
- Package is automatically discovered and registered via Laravel's automatic service provider registration.
Laravel 5.4 or earlier
composer require smajohusic/laravel-mail-logger
- Add
Smajo\MailLogger\MailLogServiceProvider::class
to providers in app.php - Execute command:
php artisan vendor:publish --provider="Smajo\MailLogger\MailLogServiceProvider"
- Run:
php artisan migrate
to generate the mail-logger table
Requirements
Cron job
To enable auto-deleting you will need to set up a cron job that runs
Usage
mailLogger.php config
By default the auto-deleting is disabled. To enable it set
You can set how long the logs should be stored in the database by giving amount in days.
To make it easier to find mails, you can define all "to" fields your app uses in forms. This will then find the user e-mail in the request, and save it as the "sender" field.