Skip to content

Commit 2bae0aa

Browse files
Merge pull request #15 from karlkeefer/urlencode_emails
urlencode() troublesome url params and consistent camelCase
2 parents 38a9894 + dcdf928 commit 2bae0aa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Api/Groups.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public function getSubscribers($groupId, $type = null, $params = [])
3434
* Get single subscriber from group
3535
*
3636
* @param $groupId
37-
* @param $subscriber_id
37+
* @param $subscriberId
3838
* @return mixed
3939
*/
40-
public function getSubscriber($groupId, $subscriber_id)
40+
public function getSubscriber($groupId, $subscriberId)
4141
{
42-
$endpoint = $this->endpoint . '/' . $groupId . '/subscribers/' . $subscriber_id;
42+
$endpoint = $this->endpoint . '/' . $groupId . '/subscribers/' . urlencode($subscriberId);
4343

4444
$response = $this->restClient->get($endpoint);
4545

@@ -73,7 +73,7 @@ public function addSubscriber($groupId, $subscriberData = [], $params = [])
7373
*/
7474
public function removeSubscriber($groupId, $subscriberId)
7575
{
76-
$endpoint = $this->endpoint . '/' . $groupId . '/subscribers/' . $subscriberId;
76+
$endpoint = $this->endpoint . '/' . $groupId . '/subscribers/' . urlencode($subscriberId);
7777

7878
$response = $this->restClient->delete($endpoint);
7979

src/Api/Subscribers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Subscribers extends ApiAbstract {
1717
*/
1818
public function getGroups($subscriberId, $params = [])
1919
{
20-
$endpoint = $this->endpoint . '/' . $subscriberId . '/groups';
20+
$endpoint = $this->endpoint . '/' . urlencode($subscriberId) . '/groups';
2121

2222
$params = array_merge($this->prepareParams(), $params);
2323

@@ -36,7 +36,7 @@ public function getGroups($subscriberId, $params = [])
3636
*/
3737
public function getActivity($subscriberId, $type = null, $params = [])
3838
{
39-
$endpoint = $this->endpoint . '/' . $subscriberId . '/activity';
39+
$endpoint = $this->endpoint . '/' . urlencode($subscriberId) . '/activity';
4040

4141
if ($type !== null) {
4242
$endpoint .= '/' . $type;

0 commit comments

Comments
 (0)