Skip to content

Commit

Permalink
Listener sample code updated to work with `Symfony\Component\Mime\Hea…
Browse files Browse the repository at this point in the history
…der\HeaderInterface` (#35)
  • Loading branch information
lrakauskas authored Oct 2, 2023
1 parent 3d6509a commit a35fd44
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,9 @@ class MessageSentListener
public function handle(MessageSent $event)
{
$headers = $event->message->getHeaders();
$postalmessageid = $headers->get('Postal-Message-ID');
$postalmessageid = explode(': ', $postalmessageid);
$postalmessageid = (count($postalmessageid) == 1) ? '' : trim($postalmessageid[1]);
$postalmessageid = $headers->get('postal-message-id')?->getBodyAsString();

if (strlen($postalmessageid) > 0) {
if ($postalmessageid) {
// do something here
}
}
Expand Down

0 comments on commit a35fd44

Please sign in to comment.