1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Harvest message ID from postmark

This commit is contained in:
David Bomba 2021-02-22 11:57:54 +11:00
parent c72fcfed64
commit 0317bae985

View File

@ -36,11 +36,22 @@ class MailSentListener implements ShouldQueue
*/
public function handle(MessageSent $event)
{
//MultiDB::setDb($event->company->db);
//$postmark_id = $message->getHeaders()->get('x-pm-message-id')->getValue();
if(property_exists($event->message, 'invitation')){
nlog($event->message->invitation);
MultiDB::setDb($event->message->invitation->company->db);
if($event->message->getHeaders()->get('x-pm-message-id')){
$postmark_id = $event->message->getHeaders()->get('x-pm-message-id')->getValue();
nlog($postmark_id);
$invitation = $event->message->invitation;
$invitation->message_id = $postmark_id;
$invitation->save();
}
}
}