Added logic to prevent empty mails for invoice report #627
@@ -352,6 +352,16 @@ class SendInvoiceReport extends Command
|
|||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent empty mails
|
||||||
|
if (
|
||||||
|
empty($filteredSerialData) &&
|
||||||
|
empty($filteredMaterialData) &&
|
||||||
|
empty($filteredBundleData)
|
||||||
|
) {
|
||||||
|
$this->warn("Skipping empty mail for rule {$rule->id}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
\Mail::to($toEmails)
|
\Mail::to($toEmails)
|
||||||
->cc($ccEmails)
|
->cc($ccEmails)
|
||||||
->send(new test(
|
->send(new test(
|
||||||
|
|||||||
Reference in New Issue
Block a user