billyct / laravel-elastic-email
本包最新版本(dev-master)的许可信息不可用。
dev-master
2018-12-17 07:40 UTC
Requires
- php: >=7.0
- elastic-email/web-api-client: ^1.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^3.5
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-09-17 21:00:43 UTC
README
一个简单的 Laravel 封装,用于 ElasticEmail.WebApiClient-php
预安装
安装
[1] 安装包
composer require billyct/laravel-elastic-email
[2] 将以下代码添加到 .env 文件中
ELASTIC_EMAIL_API_KEY=<Add your key>
ELASTIC_EMAIL_PUBLIC_ACCOUNT_ID=<Add your account>
[3] 如果您使用的是 laravel < 5.5
将提供者添加到您的 config/app.php 文件中。
'providers' => [
// other providers
Billyct\ElasticEmail\ElasticEmailServiceProvider::class,
]
用法
添加联系人
// $client is singleton wrapper for ElasticClient $client = app(ElasticEmailClient\ElasticClient::class); $client->Contact->Add(...); // or short code: Billyct\ElasticEmail\ElasticEmail::addContact('your@mail.com', 'your-list-name', ['field_1' => 'test']);