canopytax / laramandrill
此包已被废弃且不再维护。没有建议的替代包。
此包的最新版本(2.1.1)没有提供许可信息。
Mandrill API for Laravel
2.1.1
2016-06-06 20:55 UTC
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: 6.0.*
- illuminate/support: ~5.0
README
Laravel Mandrill 插件!
版本 1.x - 用于 Laravel 4.x
版本 2.x - 用于 Laravel 5.x
此 Laravel 插件基于 MichMich 的插件,但专为 composer 制作,并添加了一些其他功能。
此包是对 Mandrill API 的简单包装。
安装
首先,通过 Composer 安装此包。编辑您的项目 composer.json
文件,要求 CanopyTax/laramandrill
。
"require": {
"CanopyTax/laramandrill": "~2.0"
}
接下来,在终端中更新 Composer
composer update
此操作完成后,最后一步是添加服务提供者。打开 config/app.php
,并在提供者数组中添加一个新条目。
'CanopyTax\Laramandrill\LaramandrillServiceProvider'
在您的 config/app.php
中的 aliases
数组中添加此行
'Laramandrill' => 'CanopyTax\Laramandrill\Facades\Laramandrill'
最后,您需要添加您的 Mandrill API 密钥。生成配置文件并在 {root}/config/laramandrill.php 中编辑它
用法
调用所需的方法,并将参数作为单个数组传递。无需担心传递 API 密钥。
$response = Laramandrill::request('post', 'messages/send', array( 'message' => array( 'html' => 'Body of the message.', 'subject' => 'Subject of the message.', 'from_email' => 'monkey@somewhere.com', 'to' => array(array('email'=>'foo@bar.com')), ), ));