1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| <?php
include('php-mailjet.class-mailjet-0.1.php');
class Domaine extends Mailjet
{
private $smtp;
private $methodeDomaine = 'userDomainlist';
private $methodeSend = 'reportEmailstatistics';
private $option = array();
// private $optionSend = array(1 =>"NULL", 2 => "NULL", from_domain => "medialta.com", 4 => "NULL", 5 => "NULL", 6 => "NULL", 7 => "NULL", 8 => "NULL", 9 => "NULL", 10 => "NULL");
private $type = 'GET';
public function __construct()
{
$this->smtp = new Mailjet();
$this->option = new Mailjet();
}
public function NomDomaine()
{
$therequest = $this->smtp->sendRequest($this->methodeDomaine,$this->option,$this->type);
if($therequest === true)
{
$outgoingDomaine = $this->smtp->_response;
foreach( $outgoingDomaine->domains as $valeur)
{
echo '<tr><td>'.$valeur->domain.'</td></tr>';
}
$this->id_domaine = array($valeur->domain);
return $this->id_domaine;
}
else{
echo "Erreur de récupération des données";
}
}
public function TotalMailSend()
{
$therequest = $this->smtp->sendRequest($this->methodeSend,$this->optionSend,$this->type);
if($therequest === true)
{
$outgoingMailSend = $this->smtp->_response;
foreach( $this->NomDomaine() as $valeur)
{
echo '<td>'.$outgoingMailSend->stats->cnt_messages.'</td>';
}
}
else
{
echo "Erreur de récupération des données";
}
}
public function Tableau()
{
$ndd = $this->NomDomaine();
print_r($this->id_domaine);
foreach ($ndd as $value)
{
$this->optionSend = array(1 =>"NULL", 2 => "NULL", from_domain => $this->id_domaine, 4 => "NULL", 5 => "NULL", 6 => "NULL", 7 => "NULL", 8 => "NULL", 9 => "NULL", 10 => "NULL");
$this->TotalMailSend($this->optionSend);
}
}
}
?> |
Partager