Skip to content

Commit

Permalink
Merge pull request #27 from emailplatform/version1.2.1
Browse files Browse the repository at this point in the history
Version1.2.1
  • Loading branch information
emailplatform authored Feb 26, 2019
2 parents 58be6bb + cda23ad commit 5465a20
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 5 deletions.
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
<hr><br/>

## 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)
>
>```
<br/>
* **GetSubscribersByCustomField**
> *Definition:*
> ```php
> public function GetSubscribersByCustomField ($listid = false, $data = array(), $activeonly = true, $countonly = false, $limit = 1000, $offset = 0)
>
>```
<br/>
### _Differences between **v1.1.10** and **v1.1.11**_
#### New methods:
Expand Down
43 changes: 42 additions & 1 deletion src/ApiParser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}


}

0 comments on commit 5465a20

Please sign in to comment.