saizr / mandrill
Mandrill 官方 API 封装库,适用于 Laravel 4
1.0.4
2014-08-07 07:21 UTC
Requires
- php: >=5.3.0
- illuminate/support: >=4.1
- mandrill/mandrill: 1.0.*
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-28 14:58:08 UTC
README
安装
-
通过 composer 安装 package
-
将以下条目添加到 app/config/app.php 中找到的服务提供者数组中:
'Sairiz\Mandrill\MandrillServiceProvider',
-
通过在项目根目录下运行以下命令将配置文件发布到 app/config/ 目录:
php artisan config:publish sairiz/mandrill
-
在 app/config/packages/sairiz/mandrill/config.php 中设置您的 API 密钥
使用方法
使用 Facade 别名(Email)调用任何方法
示例
$message = array(
'subject' => 'Your subject here',
'html' => '<html><body>Your email body</body></html>',
'from_email' => 'yours@email.com',
'to' => array(array('email'=>'clients@email.com'))
);
$response = Email::messages()->send($message);
The first method is the call category while the chain method is the method within that category
有关完整方法的详细信息,请参阅官方文档:https://mandrillapp.com/api/docs/index.php.html