diff --git a/app/Listeners/Mail/MailSentListener.php b/app/Listeners/Mail/MailSentListener.php index f2cbcd736b..daf79ac9e8 100644 --- a/app/Listeners/Mail/MailSentListener.php +++ b/app/Listeners/Mail/MailSentListener.php @@ -42,13 +42,16 @@ class MailSentListener implements ShouldQueue */ public function handle(MessageSent $event) { - if(!Ninja::isHosted()); + if(!Ninja::isHosted()) return; $message_id = $event->sent->getMessageId(); $message = MessageConverter::toEmail($event->sent->getOriginalMessage()); + if(!$message->getHeaders()->get('x-invitation')) + return; + $invitation_key = $message->getHeaders()->get('x-invitation')->getValue(); if($message_id && $invitation_key)