Add event by API

Require https://github.com/mautic/api-library

$api = new \Mautic\Api\Api($auth, $apiUrl);
$response = $api->makeRequest('recommender/RecommenderEvent', [
    'eventName' => 'name of event',
    'itemId'=> 4037,
    'StayOnSale' => 0,
    'lang'=>'sk',
    'contactId' => 1 // or contactEmail  - one of this is required
], 'POST');

if(!empty($response['success']){
echo 'events added';
}

Last updated