add mailjet mailer

This commit is contained in:
Yisroel Baum 2026-05-11 10:37:45 +03:00
parent 96f4de4cf6
commit d726da1e04
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -0,0 +1,36 @@
<?php
namespace App\Email;
use Mailjet\Client;
use Mailjet\Resources;
class MailjetMailer implements Emailer
{
public function __construct(
private Client $mailjet,
private string $fromName,
) {}
public function send(string $from, string $to, string $body): void
{
$this->mailjet->post(Resources::$Email, [
'body' => [
'Messages' => [
[
'From' => [
'Email' => $from,
'Name' => $this->fromName,
],
'To' => [
[
'Email' => $to,
],
],
'Subject' => 'TIDE',
'TextPart' => $body,
],
],
],
]);
}
}