From f7d11f2a2a222d812f910e41b404e9b8fee0df2a Mon Sep 17 00:00:00 2001 From: Yazan Salhi Date: Thu, 14 May 2020 17:16:05 +0300 Subject: [PATCH 1/4] add method for delete list --- src/Klaviyo.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Klaviyo.php b/src/Klaviyo.php index 459ab16..9a50027 100644 --- a/src/Klaviyo.php +++ b/src/Klaviyo.php @@ -191,6 +191,12 @@ public function removeFromMailingList(string $listId, string $email): array ]; return $this->delete(sprintf('v1/list/%s/members/batch', $listId), $params); } + + public function deleteList(string $listId) + { + $params = []; + return $this->post("v1/list/{$listId}", $params); + } /** * @param string $endpoint From c4fab5eb66f5c8992dcc2e99981fcad8ff22bf74 Mon Sep 17 00:00:00 2001 From: Yazan Salhi Date: Sat, 16 May 2020 01:05:01 +0300 Subject: [PATCH 2/4] fix bug --- src/Klaviyo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Klaviyo.php b/src/Klaviyo.php index 9a50027..41e0ef0 100644 --- a/src/Klaviyo.php +++ b/src/Klaviyo.php @@ -195,7 +195,7 @@ public function removeFromMailingList(string $listId, string $email): array public function deleteList(string $listId) { $params = []; - return $this->post("v1/list/{$listId}", $params); + return $this->post(sprintf("v1/list/{$listId}"), $params); } /** From de52f19dcb492c11aad47a337eea82f2bd0d20a2 Mon Sep 17 00:00:00 2001 From: Yazan Salhi Date: Sat, 16 May 2020 01:08:48 +0300 Subject: [PATCH 3/4] fix bug --- src/Klaviyo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Klaviyo.php b/src/Klaviyo.php index 41e0ef0..00bba88 100644 --- a/src/Klaviyo.php +++ b/src/Klaviyo.php @@ -195,7 +195,7 @@ public function removeFromMailingList(string $listId, string $email): array public function deleteList(string $listId) { $params = []; - return $this->post(sprintf("v1/list/{$listId}"), $params); + return $this->delete(sprintf("v1/list/{$listId}"), $params); } /** From 88f9b34d52d016939c637ae087a8d0f6b83dd08c Mon Sep 17 00:00:00 2001 From: Yazan Salhi Date: Sat, 16 May 2020 01:13:18 +0300 Subject: [PATCH 4/4] fix bug --- src/Klaviyo.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Klaviyo.php b/src/Klaviyo.php index 00bba88..40391dd 100644 --- a/src/Klaviyo.php +++ b/src/Klaviyo.php @@ -194,8 +194,7 @@ public function removeFromMailingList(string $listId, string $email): array public function deleteList(string $listId) { - $params = []; - return $this->delete(sprintf("v1/list/{$listId}"), $params); + return $this->delete(sprintf("v1/list/{$listId}")); } /**