13046 - add exclusion list feature in mailjet
This commit is contained in:
parent
f9cd6e42a1
commit
651ad91be3
@ -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
|
||||
));
|
||||
}
|
||||
}
|
||||
|
26
modules/mailjet_sync/test_add_exclusion.php
Normal file
26
modules/mailjet_sync/test_add_exclusion.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Permet de syncro des clients dans les contacts mailjet
|
||||
*/
|
||||
/*
|
||||
$authorized_ip = array(
|
||||
'88.163.22.99',
|
||||
'90.63.178.63',
|
||||
'127.0.0.1'
|
||||
);
|
||||
if (!in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) {
|
||||
die('You are not allowed');
|
||||
}
|
||||
*/
|
||||
die('script disable');
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/mailjet_sync.php');
|
||||
|
||||
$api_version = (Configuration::get('MAILJETSYNC_OLD_API') == true) ? 1 : 3;
|
||||
$api_key = Configuration::get('MAILJETSYNC_API_KEY');
|
||||
$api_secret = Configuration::get('MAILJETSYNC_SECRET_KEY');
|
||||
$mj = MailjetSyncApiClientFactory::create($api_version, $api_key, $api_secret);
|
||||
|
||||
$adds = $mj->removeFromExclusionList('figaro+blocked@antadis.com');
|
||||
|
||||
var_dump($adds);
|
Loading…
Reference in New Issue
Block a user