From 8fdd79b708999cd7c6fb700cb521f0cff7991772 Mon Sep 17 00:00:00 2001 From: Jamie Warburton Date: Thu, 17 Nov 2016 14:39:17 +0000 Subject: [PATCH 1/3] Added missing function to delete a contact list --- src/Snowcap/Emarsys/Client.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Snowcap/Emarsys/Client.php b/src/Snowcap/Emarsys/Client.php index 4e923cf..9df4267 100644 --- a/src/Snowcap/Emarsys/Client.php +++ b/src/Snowcap/Emarsys/Client.php @@ -359,6 +359,17 @@ public function createContactList(array $data) return $this->send(HttpClient::POST, 'contactlist', $data); } + /** + * Deletes a contact list which can be used as recipient source for the email. + * + * @param string $listId + * @return Response + */ + public function deleteContactList($listId) + { + return $this->send(HttpClient::POST, sprintf('contactlist/%s/deletelist', $listId)); + } + /** * Creates a contact list which can be used as recipient source for the email. * From 281c6918bd9f5c9a4302bce430db8b6c4beae74e Mon Sep 17 00:00:00 2001 From: Jamie Warburton Date: Thu, 17 Nov 2016 15:57:46 +0000 Subject: [PATCH 2/3] Added missing function to list all contacts that are in a contact list --- src/Snowcap/Emarsys/Client.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Snowcap/Emarsys/Client.php b/src/Snowcap/Emarsys/Client.php index 9df4267..3c7198c 100644 --- a/src/Snowcap/Emarsys/Client.php +++ b/src/Snowcap/Emarsys/Client.php @@ -394,6 +394,18 @@ public function removeContactsFromContactList($listId, array $data) return $this->send(HttpClient::POST, sprintf('contactlist/%s/delete', $listId), $data); } + /** + * Get a list of contact IDs that are in a contact list + * + * @param string $listId + * @param array $data + * @return Response + */ + public function getContactsFromContactList($listId, array $data) + { + return $this->send(HttpClient::GET, sprintf('contactlist/%s/contacts', $listId), $data); + } + /** * Returns a list of emails. * From 675e7112bea435531e91c3a52a9c047dfb3d96ba Mon Sep 17 00:00:00 2001 From: Jamie Warburton Date: Fri, 18 Nov 2016 09:26:07 +0000 Subject: [PATCH 3/3] Added delete single contact to close #26 --- src/Snowcap/Emarsys/Client.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Snowcap/Emarsys/Client.php b/src/Snowcap/Emarsys/Client.php index 3c7198c..1c11b11 100644 --- a/src/Snowcap/Emarsys/Client.php +++ b/src/Snowcap/Emarsys/Client.php @@ -263,6 +263,17 @@ public function updateContact(array $data) return $this->send(HttpClient::PUT, 'contact', $this->mapFieldsToIds($data)); } + /** + * Deletes a single contact/recipient, identified by an external ID. + * + * @param array $data + * @return Response + */ + public function deleteContact(array $data) + { + return $this->send(HttpClient::POST, 'contact/delete', $data); + } + /** * Returns the internal ID of a contact specified by its external ID. *