foxxmd/laravel-mail-extras

Laravel 发送邮件的附加功能

0.2.2 2018-09-20 21:35 UTC

This package is auto-updated.

Last update: 2024-09-09 23:18:35 UTC


README

为您的邮件流程添加一些附加功能

此包通过添加以下功能扩展了Laravel 5 Mail

  • 尝试重试发送邮件 X 次

我相信我将来还会添加更多,但现在就这么多!

安装

需要此包

composer require "foxxmd/laravel-mail-extras"

添加包后,将 ServiceProvider 添加到 config/app.php 中的 providers 数组中

\FoxxMD\LaravelMailExtras\LaravelMailExtrasServiceProvider::class,

配置

只需在 config/mail.php 中添加此新的键值对,即可设置重试尝试的次数

'retries' => 3

如果不存在,默认为 0(正常行为)

抛出异常的默认行为也是可配置的。

'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
]

这些参数可以使用发送方法进行覆盖

EX Mail::send($view, $data, $callback, $throwOnMailFailure, $throwOnDeliveryFailure)

贡献

欢迎添加新功能!创建一个问题或提交一个PR :)

许可

此包根据 MIT 许可 许可。