src/classe/Mails.php line 40

Open in your IDE?
  1. <?php
  2. namespace App\classe;
  3. use Mailjet\Client;
  4. use Mailjet\Resources;
  5. class Mails
  6. {
  7.     private string $api_key '26b976773bbb506e02132ca576309987';
  8.     private string $api_secret_key '4804599235f648193c810de948ac73ab';
  9.  public function sendMail(  $subjet$content)
  10.  {
  11.      $mj = new Client($this->api_key$this->api_secret_keytrue,['version' => 'v3.1']);
  12.      $body = [
  13.          'Messages' => [
  14.              [
  15.                  'From' => [
  16.                      'Email' => "kkouame@sifogroup.com",
  17.                      'Name' => "SCI CAWALLY"
  18.                  ],
  19.                  'To' => [
  20.                      [
  21.                          'Email' => "sifogrouptic@gmail.com",
  22.                          'Name' => "Administrateur"
  23.                      ]
  24.                  ],
  25.                  'TemplateID' => 3998409,
  26.                  'TemplateLanguage' => true,
  27.                  'Subject' => $subjet,
  28.                  'Variables' => [
  29.                      'content' => $content,
  30.                  ]
  31.              ]
  32.          ]
  33.      ];
  34.      $response $mj->post(Resources::$Email, ['body' => $body]);
  35.      $response->success() ;
  36.  }
  37. }