-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added campaign unsubscribes endpoint
- Loading branch information
1 parent
69dc4e2
commit 3c461c1
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* This file contains the campaign bounces endpoint for MailWizzApi PHP-SDK. | ||
* | ||
* @author Serban George Cristian <cristian.serban@mailwizz.com> | ||
* @link https://www.mailwizz.com/ | ||
* @copyright 2013-2020 https://www.mailwizz.com/ | ||
*/ | ||
|
||
|
||
/** | ||
* MailWizzApi_Endpoint_CampaignUnsubscribes handles all the API calls for campaign unsubscribes. | ||
* | ||
* @author Serban George Cristian <cristian.serban@mailwizz.com> | ||
* @package MailWizzApi | ||
* @subpackage Endpoint | ||
* @since 1.0 | ||
*/ | ||
class MailWizzApi_Endpoint_CampaignUnsubscribes extends MailWizzApi_Base | ||
{ | ||
/** | ||
* Get unsubscribes from a certain campaign | ||
* | ||
* Note, the results returned by this endpoint can be cached. | ||
* | ||
* @param string $campaignUid | ||
* @param integer $page | ||
* @param integer $perPage | ||
* | ||
* @return MailWizzApi_Http_Response | ||
* @throws ReflectionException | ||
*/ | ||
public function getUnsubscribes($campaignUid, $page = 1, $perPage = 10) | ||
{ | ||
$client = new MailWizzApi_Http_Client(array( | ||
'method' => MailWizzApi_Http_Client::METHOD_GET, | ||
'url' => $this->getConfig()->getApiUrl(sprintf('campaigns/%s/unsubscribes', $campaignUid)), | ||
'paramsGet' => array( | ||
'page' => (int)$page, | ||
'per_page' => (int)$perPage, | ||
), | ||
'enableCache' => true, | ||
)); | ||
|
||
return $response = $client->request(); | ||
} | ||
} |