1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for mail sent listener

This commit is contained in:
David Bomba 2022-07-31 20:43:43 +10:00
parent 05559feeb2
commit 2ec8e21506
2 changed files with 15 additions and 13 deletions

View File

@ -35,17 +35,19 @@ class MailSentListener implements ShouldQueue
*/
public function handle(MessageSent $event)
{
if (property_exists($event->message, 'invitation') && $event->message->invitation) {
MultiDB::setDb($event->sent->invitation->company->db);
nlog("mail listener");
nlog($event);
// if (property_exists($event->message, 'invitation') && $event->message->invitation) {
// MultiDB::setDb($event->sent->invitation->company->db);
if ($event->message->getHeaders()->get('x-pm-message-id')) {
$postmark_id = $event->sent->getHeaders()->get('x-pm-message-id')->getValue();
// if ($event->message->getHeaders()->get('x-pm-message-id')) {
// $postmark_id = $event->sent->getHeaders()->get('x-pm-message-id')->getValue();
// nlog($postmark_id);
$invitation = $event->sent->invitation;
$invitation->message_id = $postmark_id;
$invitation->save();
}
}
// // nlog($postmark_id);
// $invitation = $event->sent->invitation;
// $invitation->message_id = $postmark_id;
// $invitation->save();
// }
// }
}
}

View File

@ -271,9 +271,9 @@ class EventServiceProvider extends ServiceProvider
],
MessageSending::class => [
],
MessageSent::class => [
MailSentListener::class,
],
// MessageSent::class => [
// MailSentListener::class,
// ],
UserWasCreated::class => [
CreatedUserActivity::class,
SendVerificationNotification::class,