1. Go to this page and download the library: Download 2ur1st/emarsys library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
2ur1st / emarsys example snippets
define('EMARSYS_API_USERNAME', 'your_username');
define('EMARSYS_API_SECRET', 'your_secret');
$httpClient = new CurlClient();
$client = new Client($httpClient, EMARSYS_API_USERNAME, EMARSYS_API_SECRET);
// Retrieve a contact from his email address
$response = $client->getContact(array(3 => '[email protected]'));
// Create a contact with just his email information
$response = $client->createContact(array(3 => '[email protected]'));
// Create a more complex contact
$response = $client->createContact(array(
'email' => '[email protected]',
'gender' => $client->getChoiceId('gender', 'male'),
'salutation' => $client->getChoiceId('salutation', 'mr'),
'firstName' => 'John',
'lastName' => 'Doe',
'birthDate' => '2014-03-27',
'address' => 'Forgotten street 85B',
'zip' => '1000',
'city' => 'Brussels',
'country' => 17,
'language' => 3,
));