public patch ( string $method, array $args = [], integer $timeout = 10 ) : array | false | ||
$method | string | URL of the API request method |
$args | array | Assoc array of arguments (usually your data) |
$timeout | integer | Timeout limit for request in seconds |
return | array | false | Assoc array of API response, decoded from JSON |
public function patch($method, $args = array(), $timeout = 10)
{
return $this->makeRequest('patch', $method, $args, $timeout);
}
/** * @param $email * @param string $listName * * @return array|false * * @throws \Spatie\Newsletter\Exceptions\InvalidNewsletterList */ public function unsubscribe($email, $listName = '') { $list = $this->lists->findByName($listName); $response = $this->mailChimp->patch("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}", ['status' => 'unsubscribed']); return $response; }