Skip to content

Commit

Permalink
[Mailer] [Brevo] Check that tags is present in payload before calling…
Browse files Browse the repository at this point in the history
… setTags
  • Loading branch information
palgalik authored and fabpot committed Mar 15, 2024
1 parent 9d473e3 commit 868939c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public function convert(array $payload): AbstractMailerEvent

$event->setDate($date);
$event->setRecipientEmail($payload['email']);
$event->setTags($payload['tags']);

if (isset($payload['tags'])) {
$event->setTags($payload['tags']);
}

return $event;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": 814119,
"email": "example@gmail.com",
"message-id": "<202305311313.92192897094@smtp-relay.mailin.fr>",
"date": "2023-05-31 15:13:08",
"event": "request",
"subject": "Subject Line",
"sending_ip": "127.0.0.1",
"ts_event": 1685538788,
"ts": 1685538788,
"reason": "sent",
"ts_epoch": 1685538788179
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent;

$wh = new MailerDeliveryEvent(MailerDeliveryEvent::RECEIVED, '<202305311313.92192897094@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR));
$wh->setRecipientEmail('example@gmail.com');
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1685538788));

return $wh;

0 comments on commit 868939c

Please sign in to comment.