Skip to content

Commit ee0a05e

Browse files
Prevent sending of weekly reports to deleted users
1 parent 859bf06 commit ee0a05e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/Jobs/SendWeeklyReports.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public function handle()
4949
ORDER BY spendings.amount DESC LIMIT 1', [$space->id, $lastWeekDate, $currentDate]);
5050

5151
foreach ($space->users as $user) {
52+
if (!$user->email) {
53+
continue;
54+
}
55+
5256
// Only send if user wants to receive report
5357
if ($user->weekly_report) {
5458
Mail::to($user->email)->queue(new WeeklyReport(

0 commit comments

Comments
 (0)