-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new API endpoint for "email/unsubscribe" and fixed the response object #22
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -536,6 +536,17 @@ public function getEmailResponses(array $data) | |
return $this->send(HttpClient::POST, 'email/getresponses', $data); | ||
} | ||
|
||
/** | ||
* Count the unsubscription statistics of a specific campaign. | ||
* | ||
* @param array $data | ||
* @return Response | ||
*/ | ||
public function setEmailUnsubscriptionCount(array $data) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not name a method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method removes subscribtions, so a |
||
{ | ||
return $this->send(HttpClient::POST, 'email/unsubscribe', $data); | ||
} | ||
|
||
/** | ||
* Returns a list of email categories which can be used in email creation. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,13 +34,13 @@ class Response | |
*/ | ||
function __construct(array $result = array()) | ||
{ | ||
if (!isset($result['replyCode']) || !isset($result['replyText']) || !isset($result['data'])) { | ||
if (!isset($result['replyCode']) || !isset($result['replyText']) || !array_key_exists('data', $result)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please explain this modification? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why @mwille did this, but I guess this can be dropped (the effect should be the same). |
||
throw new ClientException('Invalid result structure'); | ||
} | ||
|
||
$this->replyCode = $result['replyCode']; | ||
$this->replyText = $result['replyText']; | ||
$this->data = $result['data']; | ||
$this->data = (array) $result['data']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What will happen here if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will force |
||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there more specific type? In worse case could be
@param mixed[] $data
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what
$data
contains, somixed[]
should fit for now.