orken/mandrill-transport-cakephp3
最新稳定版本:0.97.0
Composer 安装命令:
composer require orken/mandrill-transport-cakephp3
包简介
MandrillTransport plugin for CakePHP 3+
关键字:
README 文档
README
Installation
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require orken/mandrill-transport-cakephp3
Setting up your CakePHP application
In your bootstrap.php
Plugin::load('MandrillTransport');
In your app.php file.
'EmailTransport' => [
'Mandrill' => [
'className' => 'MandrillTransport.Mandrill',
'api_key' => 'YOUR_API_KEY',
'api_key_test' => 'YOUR_TEST_API_KEY',
'from' => 'no-reply@example.com',
'merge_language' => 'handlebars', //optional, default is handlebars
'inline_css' => true, //optional, default is true
],
],
'Email' => [
'mandrill' => [
'transport' => 'Mandrill',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
],
Utilisation
It can be used like normal Mail transport in cakephp.
If you want to use a template from mailchimp/mandrill, you just have to add the key 'template_name' with the name of the template in your viewVars. And optionnaly other vars which are used in the template.
$email = new Email('mandrill');
$email->from(['me@example.com' => 'My Site'])
->to('you@example.com')
->cc('yourcc@exmaple.com') // optional
->bcc('yourbcc@exmaple.com') // optional
->attachments('/path/to/your/file') // optional
->viewVars([
'template_name' => 'your template name at mandrill',
'other_var' => 'values', // all the vars from yout template
...
])
->subject('About') // optional, if missing it takes the template subject
->send('My message');
统计信息
- 总下载量: 1.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-29