Browse Source

[backend] Gestion de la limite d'envoi d'emails de Mailjet (50)

refactoring
Guillaume Bourgeois 5 years ago
parent
commit
935d9f7762
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      backend/models/MailForm.php

+ 9
- 0
backend/models/MailForm.php View File

'TextPart' => $this->message.$messageAutoText, 'TextPart' => $this->message.$messageAutoText,
'HTMLPart' => nl2br($this->message).$messageAutoHtml 'HTMLPart' => nl2br($this->message).$messageAutoHtml
] ; ] ;

if(count($body['Messages']) == 50) {
$response = $mj->post(\Mailjet\Resources::$Email, ['body' => $body]);
$body['Messages'] = [] ;
}
}

if(count($body['Messages']) > 0) {
$response = $mj->post(\Mailjet\Resources::$Email, ['body' => $body]);
} }
$response = $mj->post(\Mailjet\Resources::$Email, ['body' => $body]); $response = $mj->post(\Mailjet\Resources::$Email, ['body' => $body]);

Loading…
Cancel
Save