Zeiterfassung Mail anpassung

This commit is contained in:
2026-03-30 20:35:13 +02:00
parent 0084516414
commit 874e8a04c0
@@ -349,11 +349,24 @@ if (!function_exists('timeErrorNotificationsFormatDateList')) {
}
}
if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) {
function timeErrorNotificationsGetTrackingUrl(): string
{
if (!empty($_SERVER['HTTP_HOST'])) {
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://';
return $protocol . $_SERVER['HTTP_HOST'] . '/zeiterfassung/';
}
return 'https://www.praxis-creutzburg.de/zeiterfassung/';
}
}
if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) {
function timeErrorNotificationsBuildEmployeeMail(array $employee, string $stage): array
{
$name = trim($employee['vorname'] . ' ' . $employee['nachname']);
$dateList = timeErrorNotificationsFormatDateList($employee['error_dates']);
$trackingUrl = timeErrorNotificationsGetTrackingUrl();
$subject = ($stage === 'employee_day_3')
? 'Erneute Erinnerung zu offenen Zeitfehlern'
: 'Erinnerung zu offenen Zeitfehlern';
@@ -361,7 +374,8 @@ if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) {
$body = '<p>Hallo ' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . ',</p>'
. '<p>in deiner Zeiterfassung gibt es weiterhin offene Buchungsfehler.</p>'
. '<p><strong>Betroffene Tage:</strong> ' . htmlspecialchars($dateList, ENT_QUOTES, 'UTF-8') . '</p>'
. '<p>Bitte korrigiere die Eintraege in der Zeiterfassung. Solange die Fehler offen bleiben, wird der Vorgang weiter verfolgt.</p>';
. '<p>Bitte korrigiere die Eintraege in der Zeiterfassung. Solange die Fehler offen bleiben, wird der Vorgang weiter verfolgt.</p>'
. '<p><a href="' . htmlspecialchars($trackingUrl, ENT_QUOTES, 'UTF-8') . '">Zur Zeiterfassung</a></p>';
return [
'subject' => $subject,
@@ -375,12 +389,14 @@ if (!function_exists('timeErrorNotificationsBuildAdminMail')) {
{
$employeeName = trim($employee['vorname'] . ' ' . $employee['nachname']);
$dateList = timeErrorNotificationsFormatDateList($employee['error_dates']);
$trackingUrl = timeErrorNotificationsGetTrackingUrl();
$subject = 'Eskalation: Offene Zeitfehler von ' . $employeeName;
$body = '<p>Bei einem Mitarbeiter bestehen weiterhin offene Zeitfehler.</p>'
. '<p><strong>Mitarbeiter:</strong> ' . htmlspecialchars($employeeName, ENT_QUOTES, 'UTF-8') . '<br>'
. '<strong>E-Mail:</strong> ' . htmlspecialchars($employee['email'], ENT_QUOTES, 'UTF-8') . '<br>'
. '<strong>Betroffene Tage:</strong> ' . htmlspecialchars($dateList, ENT_QUOTES, 'UTF-8') . '</p>'
. '<p>Bitte pruefen Sie die Zeiterfassung und stimmen Sie die Korrektur mit dem Mitarbeiter ab.</p>';
. '<p>Bitte pruefen Sie die Zeiterfassung und stimmen Sie die Korrektur mit dem Mitarbeiter ab.</p>'
. '<p><a href="' . htmlspecialchars($trackingUrl, ENT_QUOTES, 'UTF-8') . '">Zur Zeiterfassung</a></p>';
return [
'subject' => $subject,