Skip to content

Commit 568d925

Browse files
author
Justinas Pošiūnas
committed
added options when importing subscribers
1 parent 27f048b commit 568d925

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Api/Groups.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,20 @@ public function removeSubscriber($groupId, $subscriberId)
6868
*
6969
* @param int $groupId
7070
* @param array $subscribers
71+
* @param array $options
7172
* @return [type]
7273
*/
73-
public function importSubscribers($groupId, $subscribers)
74-
{
74+
public function importSubscribers(
75+
$groupId,
76+
$subscribers,
77+
$options = [
78+
'resubscribe' => false,
79+
'autoresponders' => false
80+
]
81+
) {
7582
$endpoint = $this->endpoint . '/' . $groupId . '/subscribers/import';
7683

77-
$response = $this->restClient->post($endpoint, ['subscribers' => $subscribers]);
84+
$response = $this->restClient->post($endpoint, array_merge(['subscribers' => $subscribers], $options));
7885

7986
return $response['body'];
8087
}

0 commit comments

Comments
 (0)