Skip to content

Commit

Permalink
Merge pull request #36 from emailplatform/version1.2.12
Browse files Browse the repository at this point in the history
Version1.2.12
  • Loading branch information
emailplatform authored Dec 13, 2019
2 parents a266916 + 2049e8b commit 81e07e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,24 @@ $parser = new ApiParser($settings);
```
3. Call method from ApiParser
```php
$newsletterid = 22;
$subscriberid = 155;
$info = $parser->SendNewsletter($newsletterid, $subscriberid);
$listid = 22;
$customFields = array(1,2);
$info = $parser->AddCustomFieldsToList($listid, $customFields);
var_dump($info);
```
<hr><br>

## Changelog:

### _Differences between **v1.2.11** and **v1.2.12**_
#### New method:

* **AddCustomFieldsToList**
> ```csharp
> public function AddCustomFieldsToList($listid = false, $customFields = array())
>```
<br>
### _Differences between **v1.2.10** and **v1.2.11**_
#### Method definition changed:
Expand Down
16 changes: 16 additions & 0 deletions src/ApiParser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2067,4 +2067,20 @@ public function GetSentSMSCampaignEvents ($from = false, $to = false, $limit = 1
return self::REQUEST_FAILED;
}

public function AddCustomFieldsToList($listid = false, $customFields = array())
{
$url = $this->URL . '/Lists/AddCustomFieldsToList';

if($listid && !empty($customFields))
{
$params = array (
'listid' => $listid,
'customFields' => $customFields
);
return $this->MakePostRequest($url, $params);
}

return self::REQUEST_FAILED;
}

}

0 comments on commit 81e07e4

Please sign in to comment.