Filter out empty email address in alerts

This commit is contained in:
Marcus Moore 2025-03-17 12:30:15 -07:00
parent c711278b8b
commit b26a73e385
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View file

@ -49,6 +49,7 @@ class SendExpirationAlerts extends Command
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))
->map(fn($item) => trim($item)) // Trim each email
->filter(fn($item) => !empty($item))
->all();
// Expiring Assets
$assets = Asset::getExpiringWarrantee($alert_interval);

View file

@ -55,6 +55,7 @@ class SendUpcomingAuditReport extends Command
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))
->map(fn($item) => trim($item))
->filter(fn($item) => !empty($item))
->all();