huserg / laravel-expiration-mailer
A simple package to implement a simple expiration mail notification for secrets or other reminders
Fund package maintenance!
:HuserG
Requires
- php: ^8.3
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- roave/security-advisories: dev-latest
- spatie/laravel-ray: ^1.35
README
This repo is a Laravel package to send an email to users when a secret or any value is about to expire.
Installation
You can install the package via composer:
composer require huserg/laravel-expiration-mailer
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-expiration-mailer-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-expiration-mailer-config"
This is the contents of the published config file:
return [ # for the moment it's empty ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravel-expiration-mailer-views"
Usage
Configure your route in routes/web.php
use Huserg\LaravelExpirationMailer\Http\Controllers\ExpirationMailerController; Route::group(['prefix' => 'expirations'], function () { Route::get('', [ExpirationController::class, 'index'])->name('lem.expirations.index'); Route::post('', [ExpirationController::class, 'store'])->name('lem.expirations.store'); Route::post('{id}/force-send', [ExpirationController::class, 'forceSend'])->name('lem.expirations.force-send'); });
To override default 30 and 14 days schedule, add this to your app/Console/Kernel.php
protected function schedule(Schedule $schedule): void { $schedule->command('expiration-mailer:send-email')->daily(); # or any other schedule }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.