no message

This commit is contained in:
StudioTem committed 2025-07-08 09:52:02 +02:00
1 parent 7964753a83
commit 0701a413fa
1 file changed
+11 -10
@@ -32,16 +32,17 @@ class SendNewSubTaskEmailNotification implements ShouldQueue
public function handle(SubTaskCreated $event) public function handle(SubTaskCreated $event)
{ {
// ked je v subtasku viacej userov, tak poslem 1 email notifikaciu so vsetkymi usermi, ktori su v master tasku // ked je v subtasku viacej userov, tak poslem 1 email notifikaciu so vsetkymi usermi, ktori su v master tasku
if (count($event->subtask->mastertask->subtasks) > 1) { // if (count($event->subtask->mastertask->subtasks) > 1) {
$emails = $event->subtask->mastertask->all_users_in_master_task->pluck('email')->unique()->toArray(); // $emails = $event->subtask->mastertask->all_users_in_master_task->pluck('email')->unique()->toArray();
//
if (empty($emails)) { // if (empty($emails)) {
return; // return;
} // }
//
Mail::to($emails)->send(new NewTask($event->subtask)); // Mail::to($emails)->send(new NewTask($event->subtask));
} else { // } else {
// Mail::to($event->subtask->user->email)->send(new NewTask($event->subtask));
// }
Mail::to($event->subtask->user->email)->send(new NewTask($event->subtask)); Mail::to($event->subtask->user->email)->send(new NewTask($event->subtask));
} }
} }
}