Skip to content

Commit

Permalink
added options when importing subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
Justinas Pošiūnas committed Aug 8, 2016
1 parent 27f048b commit 568d925
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Api/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,20 @@ public function removeSubscriber($groupId, $subscriberId)
*
* @param int $groupId
* @param array $subscribers
* @param array $options
* @return [type]
*/
public function importSubscribers($groupId, $subscribers)
{
public function importSubscribers(
$groupId,
$subscribers,
$options = [
'resubscribe' => false,
'autoresponders' => false
]
) {
$endpoint = $this->endpoint . '/' . $groupId . '/subscribers/import';

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

return $response['body'];
}
Expand Down

0 comments on commit 568d925

Please sign in to comment.