no message

This commit is contained in:
StudioTem committed 2025-07-04 15:54:49 +02:00
1 parent 1b7dc98915
commit 7964753a83
2 files changed
+26 -13

No files matched your search

@@ -31,6 +31,17 @@ class SendNewSubTaskEmailNotification implements ShouldQueue
*/ */
public function handle(SubTaskCreated $event) public function handle(SubTaskCreated $event)
{ {
Mail::to($event->subtask->user->email)->send(new NewTask($event->subtask)); // 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) {
$emails = $event->subtask->mastertask->all_users_in_master_task->pluck('email')->unique()->toArray();
if (empty($emails)) {
return;
}
Mail::to($emails)->send(new NewTask($event->subtask));
} else {
Mail::to($event->subtask->user->email)->send(new NewTask($event->subtask));
}
} }
} }
@@ -20,18 +20,20 @@ Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/tasks?subtask=' .
$pattern_mac = '/\\\\serverjl\\\\[^ ]*/'; $pattern_mac = '/\\\\serverjl\\\\[^ ]*/';
// Define the callback function to replace links // Define the callback function to replace links
function replace_smb_links($matches) { if (!function_exists('replace_smb_links')) {
$link = $matches[0]; function replace_smb_links($matches) {
if (strpos($link, 'smb://serverjl') === 0) { $link = $matches[0];
// Windows link if (strpos($link, 'smb://serverjl') === 0) {
$windows_link = str_replace('smb://serverjl', '\\\\serverjl\\', $link); // Windows link
return "<br>Windows: $windows_link <br> Mac: $link <br>"; $windows_link = str_replace('smb://serverjl', '\\\\serverjl\\', $link);
} elseif (strpos($link, '\\\\serverjl\\') === 0) { return "<br>Windows: $windows_link <br> Mac: $link <br>";
// Mac link } elseif (strpos($link, '\\\\serverjl\\') === 0) {
$mac_link = str_replace('\\\\serverjl\\', 'smb://serverjl', $link); // Mac link
return "<br>Windows: $link <br> Mac: $mac_link <br>"; $mac_link = str_replace('\\\\serverjl\\', 'smb://serverjl', $link);
} return "<br>Windows: $link <br> Mac: $mac_link <br>";
return $link; // In case no pattern matches, return the original link }
return $link; // In case no pattern matches, return the original link
}
} }
// Replace SMB links using the callback function // Replace SMB links using the callback function