Skip to content

Commit 5a6381d

Browse files
committed
Simplify code
1 parent 89f4300 commit 5a6381d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

administrator/components/com_joomlaupdate/src/Model/NotificationModel.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,12 @@ private function getEmailReceivers($emailGroups): array
128128
// Users can be in more than one group. Accept only one entry
129129
foreach ($usersInGroup as $user) {
130130
if (MailHelper::isEmailAddress($user->email) && $user->sendEmail === 1) {
131-
$user->email = strtolower(trim($user->email));
132-
133-
$emailReceivers[] = $user;
131+
$emailReceivers[$user->id] ??= $user;
134132
}
135133
}
136134
}
137135

138-
return array_unique($emailReceivers);
136+
return $emailReceivers;
139137
}
140138

141139
/**

0 commit comments

Comments
 (0)