Filter out empty email address in alerts
This commit is contained in:
parent
c711278b8b
commit
b26a73e385
2 changed files with 2 additions and 0 deletions
|
@ -49,6 +49,7 @@ class SendExpirationAlerts extends Command
|
||||||
// Send a rollup to the admin, if settings dictate
|
// Send a rollup to the admin, if settings dictate
|
||||||
$recipients = collect(explode(',', $settings->alert_email))
|
$recipients = collect(explode(',', $settings->alert_email))
|
||||||
->map(fn($item) => trim($item)) // Trim each email
|
->map(fn($item) => trim($item)) // Trim each email
|
||||||
|
->filter(fn($item) => !empty($item))
|
||||||
->all();
|
->all();
|
||||||
// Expiring Assets
|
// Expiring Assets
|
||||||
$assets = Asset::getExpiringWarrantee($alert_interval);
|
$assets = Asset::getExpiringWarrantee($alert_interval);
|
||||||
|
|
|
@ -55,6 +55,7 @@ class SendUpcomingAuditReport extends Command
|
||||||
// Send a rollup to the admin, if settings dictate
|
// Send a rollup to the admin, if settings dictate
|
||||||
$recipients = collect(explode(',', $settings->alert_email))
|
$recipients = collect(explode(',', $settings->alert_email))
|
||||||
->map(fn($item) => trim($item))
|
->map(fn($item) => trim($item))
|
||||||
|
->filter(fn($item) => !empty($item))
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue