From 14e9e8358de56213d9a186efa53b2d4714d39a60 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 22 Nov 2021 21:30:32 +1100 Subject: [PATCH] Only generate invitations for contacts with send_email true --- app/Services/Invoice/CreateInvitations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Invoice/CreateInvitations.php b/app/Services/Invoice/CreateInvitations.php index 07734ab6433f..fb5e26a82b7d 100644 --- a/app/Services/Invoice/CreateInvitations.php +++ b/app/Services/Invoice/CreateInvitations.php @@ -33,7 +33,7 @@ class CreateInvitations extends AbstractService public function run() { - $contacts = $this->invoice->client->contacts; + $contacts = $this->invoice->client->contacts()->where('send_email', true)->get(); if($contacts->count() == 0){ $this->createBlankContact();