Skip to content

Commit a18957d

Browse files
committed
Include output even if there is nothing to send
1 parent 13d5b72 commit a18957d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/Console/Commands/SendExpirationAlerts.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function handle()
5656
$assets = Asset::getExpiringWarrantyOrEol($alert_interval);
5757

5858
if ($assets->count() > 0) {
59-
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
59+
6060
Mail::to($recipients)->send(new ExpiringAssetsMail($assets, $alert_interval));
6161

6262
$this->table(
@@ -68,7 +68,6 @@ public function handle()
6868
// Expiring licenses
6969
$licenses = License::getExpiringLicenses($alert_interval);
7070
if ($licenses->count() > 0) {
71-
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
7271
Mail::to($recipients)->send(new ExpiringLicenseMail($licenses, $alert_interval));
7372

7473
$this->table(
@@ -77,6 +76,10 @@ public function handle()
7776
);
7877
}
7978

79+
// Send a message even if the count is 0
80+
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
81+
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
82+
8083

8184

8285
} else {

0 commit comments

Comments
 (0)