lukaszlesniewski / expertsender
Simple API for ExpertSender service
Installs: 125
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/lukaszlesniewski/expertsender
This package is auto-updated.
Last update: 2025-12-12 20:14:54 UTC
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