Skip to content

Commit f86981b

Browse files
Add notification for verified organization users (#415)
Load organization users and filter verified emails for notifications.
1 parent 20d1ccc commit f86981b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/Http/Controllers/DonationController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ public function thankYou(string $uuid)
3737

3838
Notification::route('mail', $donation->email)
3939
->notify(new UserDonationReceived($donation));
40+
41+
42+
$organizationsUsers = $donation->load('organization')
43+
->organization->load('users')->users->filter(function ($user) {
44+
return $user->hasVerifiedEmail();
45+
});
46+
47+
\Notification::send($organizationsUsers, new DonationReceived());
4048

4149
return Inertia::render('Public/Donor/ThankYou');
4250
}

0 commit comments

Comments
 (0)