laravel-emarsys-connector maintained by qortex
Description
Proivdes Laravel wrapper for qortex/php-emarsys-connector package
Author
Last update
2020/11/30 07:52
(dev-main)
License
Downloads
7
Provides connection to Emarsys Omnichannel Customer Engagement Platform API v2
Install
$ composer require qortex/laravel-emarsys-connector
$ php artisan vendor:publish
Use
First, obtain credentials for Emarsys API User.
Then, use these credentials as username and secret in config/emarsys.php file or via environmental variables:
return [
'username' => env('EMARSYS_USERNAME', ''),
'secret' => env('EMARSYS_SECRET', ''),
];
Optionally, you can change Emarsys API url (which defaults to https://api.emarsys.net/api/v2/) if you are behing reverse proxy or something:
return [
'username' => env('EMARSYS_USERNAME', ''),
'secret' => env('EMARSYS_SECRET', ''),
'apiUrl' => env('EMARSYS_API_URL', ''),
];
Then, get instance of EmarsysConnector from ConnectorService:
use Qortex\Emarsys\Services\Connector as EmarsysConnector;
use Qortex\Laravel\Emarsys\Services\ConnectorService as EmarsysConnectorService;
$emarsysConnector = new EmarsysConnectorService()->getConnector();
Finally you can use methods of the EmarsysConnector described in qortex/php-emarsys-connector package