saizr/mandrill

Mandrill 官方 API 封装库,适用于 Laravel 4

1.0.4 2014-08-07 07:21 UTC

This package is not auto-updated.

Last update: 2024-09-28 14:58:08 UTC


README

Latest Stable Version Total Downloads License

安装

  1. 通过 composer 安装 package

  2. 将以下条目添加到 app/config/app.php 中找到的服务提供者数组中: 'Sairiz\Mandrill\MandrillServiceProvider',

  3. 通过在项目根目录下运行以下命令将配置文件发布到 app/config/ 目录: php artisan config:publish sairiz/mandrill

  4. 在 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