cristiancy96 / mandrill
Mandrill 交易型邮件通过 Laravel 4
dev-master
2013-12-12 16:37 UTC
Requires
- php: >=5.3.0
- illuminate/support: 4.1.*
This package is not auto-updated.
Last update: 2024-09-24 04:40:29 UTC
README
从 Laravel 4 框架发送 Mandrill 交易型邮件。本包是对 doxxon 包的更新,并且是围绕 MichMich 的 Laravel Mandrill Bundle 的 Laravel 4 封装。
安装
-
编辑你的项目中的
composer.json文件,并添加对doxxon/laravel-mandrill-request的依赖。"require": { "laravel/framework": "4.1.*", "doxxon/laravel-mandrill-request": "dev-master" } -
从命令行更新 composer
composer update -
打开
app/config/app.php并将以下行添加到providers数组中'Doxxon\LaravelMandrillRequest\LaravelMandrillRequestServiceProvider', -
添加一个外观别名以启用简短使用。打开
app/config/app.php并将以下行添加到aliases数组中'Mandrill' => 'Doxxon\LaravelMandrillRequest\Facades\MandrillRequest', -
发布配置文件。这将允许你设置 Mandrill API 密钥
php artisan config:publish doxxon/laravel-mandrill-request -
通过编辑
config/packages/doxxon/laravel-mandrill-request/config.php来设置你的 Mandrill API 密钥
return array( 'api_key' => 'your api key here', );
从 Mandrill 控制台 获取你的 API 密钥
用法
$payload = array( 'message' => array( 'subject' => 'Transactional email via Mandrill', 'html' => 'It works!', 'from_email' => 'fromemail@example.com', 'to' => array(array('email'=>'toemail@example.com')) ) ); $response = Mandrill::request('messages/send', $payload);