Skip to content

Commit

Permalink
Prevent sending of weekly reports to deleted users
Browse files Browse the repository at this point in the history
  • Loading branch information
range-of-motion committed Oct 2, 2020
1 parent 88ca164 commit 9694d36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Jobs/SendWeeklyReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function handle()
ORDER BY spendings.amount DESC LIMIT 1', [$space->id, $lastWeekDate, $currentDate]);

foreach ($space->users as $user) {
if (!$user->email) {
continue;
}

// Only send if user wants to receive report
if ($user->weekly_report) {
Mail::to($user->email)->queue(new WeeklyReport(
Expand Down

0 comments on commit 9694d36

Please sign in to comment.