Skip to content
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

update fetch_subscribers to accept params #23

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,14 @@ public function fetch_subscriber($params)
/**
* Returns a list of subscribers
*
* @param array $params Set of arguments
* - optional
* @return \Drip\ResponseInterface
*/
public function fetch_subscribers()
public function fetch_subscribers($params = null)
{

return $this->make_request("$this->account_id/subscribers");
return $this->make_request("$this->account_id/subscribers", $params);
}

/**
Expand Down Expand Up @@ -231,6 +233,21 @@ public function unsubscribe_subscriber($params)
return $this->make_request("$this->account_id/subscribers/$subscriber_id/unsubscribe", $params, self::POST);
}

/**
* Sends a request to add/update a batch (up to 1000) of subscribers
*
* @param array $params
* @return \Drip\ResponseInterface
*/
public function unsubscribe_subscribers($params)
{
return $this->make_request(
"$this->account_id/unsubscribes/batches",
$params,
self::POST
);
}

/**
*
* This calls POST /:account_id/tags to add the tag. It just returns some status code no content
Expand Down