|
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace common\components\BulkMailer; |
|
|
|
|
|
|
|
use domain\User\User\UserSolver; |
|
|
|
use GuzzleHttp\Client; |
|
|
|
use Psr\Http\Message\ResponseInterface; |
|
|
|
|
|
|
@@ -9,6 +10,7 @@ class BulkMailerBrevo implements BulkMailerInterface |
|
|
|
{ |
|
|
|
public function sendEmails(array $contactsArray, string $fromName, string $fromEmail, string $subject, string $htmlContent, string $textContent = null) |
|
|
|
{ |
|
|
|
$userSolver = UserSolver::getInstance(); |
|
|
|
$client = new Client(); |
|
|
|
$data = [ |
|
|
|
'sender' => [ |
|
|
@@ -21,9 +23,8 @@ class BulkMailerBrevo implements BulkMailerInterface |
|
|
|
] ; |
|
|
|
|
|
|
|
foreach($contactsArray as $user) { |
|
|
|
|
|
|
|
$data['to'][] = [ |
|
|
|
'name' => $user['name'].' '.$user['lastname'], |
|
|
|
'name' => $userSolver->getUsernameFromArray($user), |
|
|
|
'email' => $user['email'] |
|
|
|
]; |
|
|
|
|