Browse Source

Merge branch 'hotfix/hotfix_1693'

master
Guillaume Bourgeois 6 months ago
parent
commit
4c2d9581e6
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      common/components/BulkMailer/BulkMailerBrevo.php

+ 3
- 2
common/components/BulkMailer/BulkMailerBrevo.php View File



namespace common\components\BulkMailer; namespace common\components\BulkMailer;


use domain\User\User\UserSolver;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;


{ {
public function sendEmails(array $contactsArray, string $fromName, string $fromEmail, string $subject, string $htmlContent, string $textContent = null) public function sendEmails(array $contactsArray, string $fromName, string $fromEmail, string $subject, string $htmlContent, string $textContent = null)
{ {
$userSolver = UserSolver::getInstance();
$client = new Client(); $client = new Client();
$data = [ $data = [
'sender' => [ 'sender' => [
] ; ] ;


foreach($contactsArray as $user) { foreach($contactsArray as $user) {

$data['to'][] = [ $data['to'][] = [
'name' => $user['name'].' '.$user['lastname'],
'name' => $userSolver->getUsernameFromArray($user),
'email' => $user['email'] 'email' => $user['email']
]; ];



Loading…
Cancel
Save