Skip to content

Commit 55fa4fb

Browse files
committed
add method bookCountSubscriptions
1 parent 961c8ad commit 55fa4fb

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

src/ApiClient.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,24 @@ public function getEmailsFromBook($id, $limit = null, $offset = null)
388388
return $this->handleResult($requestResult);
389389
}
390390

391+
/**
392+
* Get amount of subscriptions for the book
393+
*
394+
* @param $bookID
395+
*
396+
* @return stdClass
397+
*/
398+
public function bookCountSubscriptions($bookID)
399+
{
400+
if (empty($bookID)) {
401+
return $this->handleError('Empty book id');
402+
}
403+
404+
$requestResult = $this->sendRequest('addressbooks/' . $bookID . '/emails/total');
405+
406+
return $this->handleResult($requestResult);
407+
}
408+
391409
/**
392410
* Add new emails to address book
393411
*

src/ApiInterface.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ public function getBookInfo($id);
6060
public function getBookVariables($id);
6161

6262
/**
63-
* Get list pf emails from book
63+
* Get list email addresses from book
6464
*
65-
* @param $id
65+
* @param $id Address book id.
66+
* @param $limit
67+
* @param $offset
68+
*/
69+
public function getEmailsFromBook($id, $limit = null, $offset = null);
70+
71+
/**
72+
* Get amount of subscriptions for the book
73+
*
74+
* @param $bookID
6675
*/
67-
public function getEmailsFromBook($id);
76+
public function bookCountSubscriptions($bookID);
6877

6978
/**
7079
* Add new emails to book

0 commit comments

Comments
 (0)