|
@@ 169-178 (lines=10) @@
|
| 166 |
|
* |
| 167 |
|
* @throws \Spatie\Newsletter\Exceptions\InvalidNewsletterList |
| 168 |
|
*/ |
| 169 |
|
public function unsubscribe($email, $listName = '') |
| 170 |
|
{ |
| 171 |
|
$list = $this->lists->findByName($listName); |
| 172 |
|
|
| 173 |
|
$response = $this->mailChimp->patch("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}", [ |
| 174 |
|
'status' => 'unsubscribed', |
| 175 |
|
]); |
| 176 |
|
|
| 177 |
|
return $response; |
| 178 |
|
} |
| 179 |
|
|
| 180 |
|
/** |
| 181 |
|
* Update the email address of an existing list member. |
|
@@ 191-200 (lines=10) @@
|
| 188 |
|
* |
| 189 |
|
* @throws \Spatie\Newsletter\Exceptions\InvalidNewsletterList |
| 190 |
|
*/ |
| 191 |
|
public function updateEmailAddress($currentEmailAddress, $newEmailAddress, $listName = '') |
| 192 |
|
{ |
| 193 |
|
$list = $this->lists->findByName($listName); |
| 194 |
|
|
| 195 |
|
$response = $this->mailChimp->patch("lists/{$list->getId()}/members/{$this->getSubscriberHash($currentEmailAddress)}", [ |
| 196 |
|
'email_address' => $newEmailAddress, |
| 197 |
|
]); |
| 198 |
|
|
| 199 |
|
return $response; |
| 200 |
|
} |
| 201 |
|
|
| 202 |
|
/** |
| 203 |
|
* @param $email |