Skip to content

Commit 125351e

Browse files
Merge pull request #34 from mailerlite/master
Update develop
2 parents 8d38c33 + 2f4b874 commit 125351e

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 MailerLite
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
"license": "MIT",
66
"keywords": ["mailerlite", "sdk", "email", "marketing"],
77
"type": "library",
8+
"authors": [
9+
{
10+
"name": "Justinas Pošiūnas",
11+
"email": "justinas.posiunas@mailerlite.com",
12+
"homepage": "https://mailerlite.com",
13+
"role": "Developer"
14+
}
15+
],
816
"require": {
917
"php" : "^5.5|^7.0",
1018
"guzzlehttp/psr7": "~1.2",

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)