diff --git a/README.md b/README.md index ed78e5b..153e184 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,43 @@ $parser = new ApiParser($settings); ``` 3. Call method from ApiParser ```php -$autoresponderid = 1; -$startDate = "01.11.2018"; -$endDate = "04.11.2018"; -$parser->GetAutoresponderSummary($newsletterid, $startDate, $endDate); +$listid = 1; +$data = array( + array( + 'fieldid' => 8, + 'fieldvalue' => 'Copenhagen' + ) + ); +$activeonly = true; +$countonly = false; +$limit = 100; +$offset = 1; + +$parser->GetSubscribersByCustomField($listid, $data, $activeonly, $countonly, $limit, $offset); ```

## Changelog: +### _Differences between **v1.1.11** and **v1.2.1**_ +#### New methods: + +* **AddToOTMDocument** +> *Definition:* +> ```php +> public function AddToOTMDocument ($listid = false, $subscriberid = false, $emailaddress = false, $mobile = false, $mobilePrefix = false, $fieldid = false, $values = array(), $path = false) +> +>``` +
+ +* **GetSubscribersByCustomField** +> *Definition:* +> ```php +> public function GetSubscribersByCustomField ($listid = false, $data = array(), $activeonly = true, $countonly = false, $limit = 1000, $offset = 0) +> +>``` +
+ + ### _Differences between **v1.1.10** and **v1.1.11**_ #### New methods: diff --git a/src/ApiParser.class.php b/src/ApiParser.class.php index cafbd4d..2a468a3 100644 --- a/src/ApiParser.class.php +++ b/src/ApiParser.class.php @@ -9,8 +9,9 @@ class ApiParser var $settings = array (); + /** Production **/ - var $URL = 'https://api.mailmailmail.net/v1.1'; + var $URL = 'https://api.mailmailmail.net/v1.1'; public function __construct ($settings = array()) { @@ -728,6 +729,26 @@ public function GetSubscribers ($searchinfo = array(), $countonly = false, $limi return $this->MakeGetRequest($url, $params); } + + public function GetSubscribersByCustomField ($listid = false, $data = array(), $activeonly = true, $countonly = false, $limit = 1000, $offset = 0) + { + $url = $this->URL . '/Subscribers/GetSubscribersByCustomField'; + + if(!empty($data) && $listid) + { + $params = array ( + 'listid' => $listid, + 'data' => $data, + 'activeonly' => $activeonly, + 'countonly' => $countonly, + 'limit' => $limit, + 'offset' => $offset + ); + return $this->MakeGetRequest($url, $params); + } + return self::REQUEST_FAILED; + } + /** * GetSubscriberDetails * Gets subscriber data including all related events and bounces. @@ -1571,6 +1592,26 @@ public function GetAutoresponderSummary($autoresponderid = false, $from = false, return self::REQUEST_FAILED; } + public function AddToOTMDocument ($listid = false, $subscriberid = false, $emailaddress = false, $mobile = false, $mobilePrefix = false, $fieldid = false, + $values = array(), $path = false) + { + $url = $this->URL . '/Subscribers/AddToOTMDocument'; + if($listid && ($subscriberid || $emailaddress || ($mobile && $mobilePrefix)) && $fieldid && !empty($values)) + { + $params = array( + 'listid' => $listid, + 'subscriberid' => $subscriberid, + 'emailaddress' => $emailaddress, + 'mobile' => $mobile, + 'mobilePrefix' => $mobilePrefix, + 'fieldid' => $fieldid, + 'path' => $path, + 'values' => $values + ); + return $this->MakePostRequest($url, $params); + } + return self::REQUEST_FAILED; + } }