Add event by API
1
$api = new \Mautic\Api\Api($auth, $apiUrl);
2
$response = $api->makeRequest('recommender/RecommenderEvent', [
3
'eventName' => 'name of event',
4
'itemId'=> 4037,
5
'StayOnSale' => 0,
6
'lang'=>'sk',
7
'contactId' => 1 // or contactEmail - one of this is required
8
], 'POST');
9
10
if(!empty($response['success']){
11
echo 'events added';
12
}
Copied!
Last modified 2yr ago
Copy link