gwk / mailjetbundle
Symfony 2 的 Mailjet 扩展包
0.1.2
2013-02-11 14:01 UTC
Requires
- php: >=5.3.3
This package is not auto-updated.
Last update: 2024-09-28 14:06:57 UTC
README
此扩展包使得从 Symfony 2 库中使用 Mailjet 库变得简单
安装
只需将以下内容添加到您的 composer.json 文件中
{ "require": { "gwk/mailjetbundle": "0.1" } }
然后使用 composer 安装扩展包
composer.phar update gwk/mailjetbundle
现在将扩展包添加到您的 app/AppKernel.php 文件中
$bundles[] = new GWK\MailjetBundle\GWKMailjetBundle();
配置
gwk_mailjet: api_key: "YOUR API KEY" # Required secret_key: "YOUR SECRET KEY" # Required debug: true # Optional, defaults to %kernel.debug% debug_level: 2 # Optional, Mailjet debug level, defaults to 1 not used if debug = false format: xml # Optional, the format in which to receive results, defaults to json
使用
在您的代码中,只需请求 "mailjet" 服务即可开始使用它
$mailjet = $this->get("mailjet"); $mailjet->listsAddContact(array('method' => 'POST', 'contact' => 'foo@bar.com', 'id' => '%list_id%'));
许可证
MIT, 查看 LICENSE
警告 Mailjet 没有为他们的库附加许可证,所以我假设这是公有领域代码。