From b7ade4911af8aa54d70b488c4002a9bdbe9eb06f Mon Sep 17 00:00:00 2001 From: Gaurav Gusain Date: Sat, 14 Sep 2024 02:09:13 +0530 Subject: [PATCH] minor fix --- Modules/Invoice/Console/SendUpcomingInvoiceReminder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/Invoice/Console/SendUpcomingInvoiceReminder.php b/Modules/Invoice/Console/SendUpcomingInvoiceReminder.php index 3e39809de0..4e934b882c 100644 --- a/Modules/Invoice/Console/SendUpcomingInvoiceReminder.php +++ b/Modules/Invoice/Console/SendUpcomingInvoiceReminder.php @@ -32,6 +32,8 @@ public function handle() { $service = app(InvoiceService::class); $upcomingInvoices = $service->getScheduledInvoicesForMail(); - Mail::send(new SendInvoiceReminderMail($upcomingInvoices)); + if ($upcomingInvoices->count()) { + Mail::send(new SendInvoiceReminderMail($upcomingInvoices)); + } } }