mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
links in email notifications
This commit is contained in:
1 parent
840e644d55
commit
c4d4a2c7e5
2 files changed
+35
-6
No files matched your search
@@ -13,9 +13,31 @@ Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/tasks?subtask=' .
|
||||
|
||||
@php
|
||||
|
||||
$description = ($subtask->description) ?: $subtask->mastertask->description;
|
||||
|
||||
// Define regular expressions for Windows and Mac SMB links
|
||||
$pattern_windows = '/smb:\/\/serverjl[^ ]*/';
|
||||
$pattern_mac = '/\\\\serverjl\\\\[^ ]*/';
|
||||
|
||||
// Define the callback function to replace links
|
||||
function replace_smb_links($matches) {
|
||||
$link = $matches[0];
|
||||
if (strpos($link, 'smb://serverjl') === 0) {
|
||||
// Windows link
|
||||
$mac_link = str_replace('smb://serverjl', '\\\\serverjl\\', $link);
|
||||
return "<br>Windows: $link <br> Mac: $mac_link <br>";
|
||||
} elseif (strpos($link, '\\\\serverjl\\') === 0) {
|
||||
// Mac link
|
||||
$windows_link = str_replace('\\\\serverjl\\', 'smb://serverjl', $link);
|
||||
return "<br>Windows: $windows_link <br> Mac: $link <br>";
|
||||
}
|
||||
return $link; // In case no pattern matches, return the original link
|
||||
}
|
||||
|
||||
// Replace SMB links using the callback function
|
||||
$description = preg_replace_callback($pattern_windows, 'replace_smb_links', $description);
|
||||
$description = preg_replace_callback($pattern_mac, 'replace_smb_links', $description);
|
||||
|
||||
$test = 'testtesttest';
|
||||
@endphp
|
||||
|
||||
Popis: {!!($subtask->description) ?: $subtask->mastertask->description !!} <br>
|
||||
Popis2: {{$test}} <br>
|
||||
Popis: {!!$description!!} <br>
|
||||
Reference in new issue
Block a user