@@ 165-176 (lines=12) @@ | ||
162 | return $this->mailChimp->get("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags"); |
|
163 | } |
|
164 | ||
165 | public function addTags(array $tags, string $email, string $listName = '') |
|
166 | { |
|
167 | $list = $this->lists->findByName($listName); |
|
168 | ||
169 | $payload = collect($tags)->map(function ($tag) { |
|
170 | return ['name' => $tag, 'status' => 'active']; |
|
171 | })->toArray(); |
|
172 | ||
173 | return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [ |
|
174 | 'tags' => $payload, |
|
175 | ]); |
|
176 | } |
|
177 | ||
178 | public function removeTags(array $tags, string $email, string $listName = '') |
|
179 | { |
|
@@ 178-189 (lines=12) @@ | ||
175 | ]); |
|
176 | } |
|
177 | ||
178 | public function removeTags(array $tags, string $email, string $listName = '') |
|
179 | { |
|
180 | $list = $this->lists->findByName($listName); |
|
181 | ||
182 | $payload = collect($tags)->map(function ($tag) { |
|
183 | return ['name' => $tag, 'status' => 'inactive']; |
|
184 | })->toArray(); |
|
185 | ||
186 | return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [ |
|
187 | 'tags' => $payload, |
|
188 | ]); |
|
189 | } |
|
190 | ||
191 | public function createCampaign( |
|
192 | string $fromName, |