mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge 569110d1ff
into 64f49afce1
This commit is contained in:
commit
ebae24bbff
|
@ -52,7 +52,17 @@ class SendExpectedCheckinAlerts extends Command
|
|||
|
||||
|
||||
foreach ($assets as $asset) {
|
||||
if ($asset->assignedTo && (isset($asset->assignedTo->email)) && ($asset->assignedTo->email!='') && $asset->checkedOutToUser()) {
|
||||
if ($asset->assignedTo
|
||||
&& (isset($asset->assignedTo->email))
|
||||
&& ($asset->assignedTo->email!='')
|
||||
&& $asset->checkedOutToUser()) {
|
||||
$email = $asset->assignedTo->email;
|
||||
// Check if the email contains only ASCII characters
|
||||
if (!preg_match('/^[\x00-\x7F]+$/', $email)) {
|
||||
$this->info("Skipping invalid email: {$email}");
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->info('Sending User ExpectedCheckinNotification to: '.$asset->assignedTo->email);
|
||||
$asset->assignedTo->notify((new ExpectedCheckinNotification($asset)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue