techinasia/laravel-mandrill-notification-channel
Composer 安装命令:
composer require techinasia/laravel-mandrill-notification-channel
包简介
Mandrill Notifications Channel for Laravel 5.3
README 文档
README
Use Laravel 5.3 notifications to send mail via Mandrill.
Contents
Installation
Install this package with Composer:
composer require techinasia/laravel-mandrill-notification-channel
Register the service provider in your config/app.php:
NotificationChannels\Mandrill\MandrillServiceProvider::class
Setting up Mandrill
Add your API key to your configuration at config/services.php:
'mandrill' => [ 'secret' => env('MANDRILL_SECRET', ''), ],
Usage
Send mails via Mandrill in your notification:
use NotificationChannels\Mandrill\MandrillChannel; use NotificationChannels\Mandrill\MandrillMessage; use Illuminate\Notifications\Notification; class TestNotification extends Notification { public function via($notifiable) { return [MandrillChannel::class]; } public function toMandrill($notifiable) { return (new MandrillMessage()) ->template('foo-bar', ['foo' => 'bar']); } }
You need to specify the email address and name of the notifiable by defining a routeNotificationForMandrill method on the entity:
/** * Route notifications for the Mandrill channel. * * @return array */ public function routeNotificationForMandrill() { return [ 'email' => $this->email, 'name' => $this->name ]; }
You can also specify multiple recipients by supplying an list similar to the to[] struct of Mandrill API:
/** * Route notifications for the Mandrill channel. * * @return array */ public function routeNotificationForMandrill() { return [ [ 'email' => 'a@bar.com', 'name' => 'User A', 'type' => 'to', ], [ 'email' => 'b@bar.com', 'name' => 'User B', 'type' => 'cc', ] ]; }
Available Message methods
template(string $name, array $content): Sets the template name and content of the message. If this is set,send-templatewill be used instead ofsend.
The following methods work the same as the parameters in send and send-template calls from the Mandrill API.
async(bool $value = true): Enable a background sending mode that is optimized for bulk sending.ip_pool(string $name): Name of the dedicated ip pool that should be used to send the message.send_at(DateTime $datetime): Date / time of when to send the message. Object will be converted to UTC.
You can set any attributes of the message struct by calling the name of attribute in camel case with the value as the parameter:
return (new MandrillMessage()) ->subject('Test Subject') ->mergeLanguage('handlebars');
Changelog
Please see CHANGELOG for more information for what has changed recently.
Testing
composer test
Security
If you discover any security related issues, please email dev@techinasia.com instead of using the issues tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
techinasia/laravel-mandrill-notification-channel 适用场景与选型建议
techinasia/laravel-mandrill-notification-channel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24.9k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2017 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「notifications」 「laravel」 「mandrill」 「channel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 techinasia/laravel-mandrill-notification-channel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 techinasia/laravel-mandrill-notification-channel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 techinasia/laravel-mandrill-notification-channel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova package that adds a notification feed in your Nova app.
PHP Library to send email across all platforms using one interface.
An updated fork (psr-0 to psr-4) from the original library "Mandrill/Mandrill" (https://bitbucket.org/mailchimp/mandrill-api-php)
Magento2 email providers integration (smtp, mandrill, amazon ses)
Laravel 9+ Mandrill Driver & Webhooks handler
Magento2 email providers integration (smtp, mandrill, amazon ses)
统计信息
- 总下载量: 24.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-09