lukaszlesniewski/expertsender
Composer 安装命令:
composer require lukaszlesniewski/expertsender
包简介
Simple API for ExpertSender service
README 文档
README
Simple ExpertSender Service API (ECDP) for Laravel
Installation
-
Require package:
composer require lukaszlesniewski/expertsender -
Add following package service provider in config/app.php file:
Lukaszlesniewski\ExpertSender\Providers\ExpertSenderProvider::class -
Publish package config:
php artisan vendor:publish --provider="Lukaszlesniewski\ExpertSender\Providers\ExpertSenderProvider"
Usage examples
Add new subscriber
$es = new Customers(YOUR_API_KEY);
$es->setEmail($email);
$es->setConsentsData(1, 'True');
$es->setConsentsData(2, 'True');
$result = $es->add(ExpertSenderEnum::MODE_ADD);
if ($result->ifSuccess()) { ... }
Get information about the subscriber by e-mail
$es = new Customers(YOUR_API_KEY);
$result = $es->getByEmail($customerEmail);
Get information about the subscriber by customer ID
$es = new Customers(YOUR_API_KEY);
$result = $es->getById($customerId);
Results object
You can use the following methods to read result of the request
ifSuccess()– returns true if http_code for request is less than 299getCode()– returns http code for requestgetInfo($option)– returns the information defined in $option variable; if $option is null, it returns the array containing all informationgetResponse()– returns array containing the resultgetMessage()– returns the message based on the http code
统计信息
- 总下载量: 125
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-11