beanstalkhq/laramandrill

此包已被弃用,不再维护。作者建议使用canopytax/laramandrill包。
此包的最新版本(2.1.1)没有可用的许可证信息。

Mandrill API for Laravel

2.1.1 2016-06-06 20:55 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:40:43 UTC


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,并将新项目添加到providers数组中。

'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')),
	),
));