swiftmailer-postmark
swiftmailer-postmark copied to clipboard
Retrieve MessageID from response
Is there a way to do this currently? Other packages such as https://github.com/craigpaul/laravel-postmark add this as a header like so when the message is sent:
$message->getHeaders()->addTextHeader(
'X-PM-Message-Id',
$this->getMessageId($response)
);
I'd like to use this package as it is the Laravel recommendation but require this functionality. Would you be interested in a Pull Request?
Any news on this one? I would like to retrieve the Postmark ID after sending the mail, can't figure out how!
The way I acheieved this is listen for the Illuminate\Mail\Events\MessageSent Event and in the listener you can retrieve the ID
public function handle(MessageSent $email)
{
$email->message->getHeaders()->get('X-PM-Message-Id')->getValue()
}
The way I acheieved this is listen for the Illuminate\Mail\Events\MessageSent Event and in the listener you can retrieve the ID
public function handle(MessageSent $email) { $email->message->getHeaders()->get('X-PM-Message-Id')->getValue() }
I doubt this works in the current version. Created a PR to support this.