Skip to content

Commit

Permalink
Only send reminders to users with team attendance
Browse files Browse the repository at this point in the history
Closes #4497
  • Loading branch information
kberzinch committed Mar 21, 2024
1 parent d24f693 commit ed359ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Jobs/SendReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Jobs;

use App\Models\DuesPackage;
use App\Models\Team;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
Expand Down Expand Up @@ -66,7 +67,7 @@ public function handle(): void
DuesPackage::whereDate('effective_end', '<', Carbon::now())
->whereDate('access_end', '>', Carbon::now())
->doesntExist() &&
$this->user->attendance()->exists()
$this->user->attendance()->where('attendable_type', '=', Team::getMorphClassStatic())->exists()
) {
SendDuesTransactionReminder::dispatch($this->user);

Expand Down

0 comments on commit ed359ac

Please sign in to comment.