doxxon/ laravel-mandrill-request
通过Laravel 4发送Mandrill交易电子邮件
v1.0.1
2013-12-27 16:10 UTC
Requires
- php: >=5.3.0
- illuminate/support: ~4
This package is not auto-updated.
Last update: 2024-09-28 13:01:51 UTC
README
从Laravel 4框架发送Mandrill交易电子邮件。此包是Laravel 4对MichMich的Laravel Mandrill Bundle的包装。
安装
-
编辑您的项目
composer.json文件,并添加对doxxon/laravel-mandrill-request的需求。"require": { "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);