qortex/laravel-emarsys-connector

Proivdes Laravel wrapper for qortex/php-emarsys-connector package

0.0.4 2020-11-29 21:11 UTC

This package is auto-updated.

Last update: 2024-04-29 04:46:49 UTC


README

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