Only generate invitations for contacts with send_email true

This commit is contained in:
David Bomba 2021-11-22 21:30:32 +11:00
parent 24c733827b
commit 14e9e8358d

View File

@ -33,7 +33,7 @@ class CreateInvitations extends AbstractService
public function run() public function run()
{ {
$contacts = $this->invoice->client->contacts; $contacts = $this->invoice->client->contacts()->where('send_email', true)->get();
if($contacts->count() == 0){ if($contacts->count() == 0){
$this->createBlankContact(); $this->createBlankContact();