laravel-sendgrid-driver
laravel-sendgrid-driver copied to clipboard
Set X-Message-Id with SentMessage::setMessageId
WHAT
Propose using setMessageId()
instead of headers for X-Message-Id
WHY
Event::listen(function (MessageSent $event) {
// when sendgrid ID set with headers
$sendgridId = $event->message->getHeaders()->getHeaderBody('x-sendgrid-message-id');
// when sendgrid ID set with setMessageId()
$sendgridId = $event->sent->getMessageId();
});