@@ 186-197 (lines=12) @@ | ||
183 | return $this->mailChimp->get("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags"); |
|
184 | } |
|
185 | ||
186 | public function addTags(array $tags, string $email, string $listName = '') |
|
187 | { |
|
188 | $list = $this->lists->findByName($listName); |
|
189 | ||
190 | $payload = collect($tags)->mapWithKeys(function ($tag) { |
|
191 | return [$tag => 'active']; |
|
192 | })->toArray(); |
|
193 | ||
194 | return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [ |
|
195 | 'tags' => $payload, |
|
196 | ]); |
|
197 | } |
|
198 | ||
199 | public function removeTags(array $tags, string $email, string $listName = '') |
|
200 | { |
|
@@ 199-210 (lines=12) @@ | ||
196 | ]); |
|
197 | } |
|
198 | ||
199 | public function removeTags(array $tags, string $email, string $listName = '') |
|
200 | { |
|
201 | $list = $this->lists->findByName($listName); |
|
202 | ||
203 | $payload = collect($tags)->mapWithKeys(function ($tag) { |
|
204 | return [$tag => 'inactive']; |
|
205 | })->toArray(); |
|
206 | ||
207 | return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [ |
|
208 | 'tags' => $payload, |
|
209 | ]); |
|
210 | } |
|
211 | ||
212 | public function createCampaign( |
|
213 | string $fromName, |