Skip to content

Commit 3cb09db

Browse files
authored
Merge pull request #18 from mdzhym/master
Added method for start event Automation360
2 parents 7de70c7 + d288ef9 commit 3cb09db

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/ApiClient.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,4 +1172,24 @@ public function getPushCampaignStat($campaignID)
11721172

11731173
return $this->handleResult($requestResult);
11741174
}
1175+
1176+
/**
1177+
* @Author Maksym Dzhym [email protected]
1178+
* @param $eventName
1179+
* @param array $variables
1180+
* @return stdClass
1181+
*/
1182+
public function startEventAutomation360($eventName, array $variables)
1183+
{
1184+
if (!$eventName) {
1185+
return $this->handleError('Event name is empty');
1186+
}
1187+
if (!array_key_exists('email', $variables) && !array_key_exists('phone', $variables)) {
1188+
return $this->handleError('Email and phone is empty');
1189+
}
1190+
1191+
$requestResult = $this->sendRequest('events/name/' . $eventName, 'POST', $variables);
1192+
1193+
return $this->handleResult($requestResult);
1194+
}
11751195
}

src/ApiInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,12 @@ public function createPushTask($taskInfo, array $additionalParams = array());
378378
* @param $websiteID
379379
*/
380380
public function getPushIntegrationCode($websiteID);
381+
382+
/**
383+
* @Author Maksym Dzhym [email protected]
384+
* @param $eventName
385+
* @param array $variables
386+
* @return \stdClass
387+
*/
388+
public function startEventAutomation360($eventName, array $variables);
381389
}

0 commit comments

Comments
 (0)