foxxmd / laravel-mail-extras
Extra functionality for sending mail with Laravel
Installs: 10 819
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
- illuminate/container: 5.2.*|5.1.*|5.3.*
- illuminate/contracts: 5.2.*|5.1.*|5.3.*
- illuminate/log: 5.2.*|5.1.*|5.3.*
- illuminate/mail: 5.2.*|5.1.*|5.3.*
- illuminate/support: 5.2.*|5.1.*|5.3.*
This package is auto-updated.
Last update: 2024-11-09 23:43:29 UTC
README
Add some extra functionality to your mail flow
This package extends Laravel 5 Mail by adding:
- Attempt to retry sending mail X times
I'm sure I will be adding more in the future, but that's it for now!
Installation
Require this package
composer require "foxxmd/laravel-mail-extras"
After adding the package, add the ServiceProvider to the providers array in config/app.php
\FoxxMD\LaravelMailExtras\LaravelMailExtrasServiceProvider::class,
Configuration
Simply add this new key/value anywhere in config/mail.php
to set the number of retry attempts:
'retries' => 3
It defaults to 0 if not present (normal behavior)
Default behavior for throwing exceptions is also configurable.
'exceptions' => [ 'mailFailure' => true, // will throw a MailFailureExeption if any exception is thrown during sending mail 'deliveryFailure' => false // will throw a MailDeliveryException if any recipients fail to recieve mail during delivery ]
These parameters can be overridden using the send method
EX Mail::send($view, $data, $callback, $throwOnMailFailure, $throwOnDeliveryFailure)
Contributing
New functionality is welcomed! Create an issue or submit a PR :)
License
This package is licensed under the MIT license.