From 651ad91be3800937b33b44a183ce201035d52127 Mon Sep 17 00:00:00 2001 From: Rodney Figaro Date: Fri, 21 Apr 2017 18:33:22 +0200 Subject: [PATCH] 13046 - add exclusion list feature in mailjet --- .../mailjet_sync/libraries/mailjet_api_v3.php | 18 +++++++++++++ modules/mailjet_sync/test_add_exclusion.php | 26 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 modules/mailjet_sync/test_add_exclusion.php diff --git a/modules/mailjet_sync/libraries/mailjet_api_v3.php b/modules/mailjet_sync/libraries/mailjet_api_v3.php index 3e4bb82b..5492a6b6 100755 --- a/modules/mailjet_sync/libraries/mailjet_api_v3.php +++ b/modules/mailjet_sync/libraries/mailjet_api_v3.php @@ -148,4 +148,22 @@ class MailjetSyncApiClientV3 implements IMailjetSyncApiClient "JobID" => $jobid )); } + + public function addInExclusionList($email) + { + return $this->client->contact(array( + "method" => 'PUT', + "isExcludedFromCampaigns" => true, + "ID" => $email + )); + } + + public function removeFromExclusionList($email) + { + return $this->client->contact(array( + "method" => 'PUT', + "isExcludedFromCampaigns" => false, + "ID" => $email + )); + } } diff --git a/modules/mailjet_sync/test_add_exclusion.php b/modules/mailjet_sync/test_add_exclusion.php new file mode 100644 index 00000000..687ff285 --- /dev/null +++ b/modules/mailjet_sync/test_add_exclusion.php @@ -0,0 +1,26 @@ +removeFromExclusionList('figaro+blocked@antadis.com'); + +var_dump($adds);