Zeiterfassung Mail anpassung
This commit is contained in:
@@ -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')) {
|
if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) {
|
||||||
function timeErrorNotificationsBuildEmployeeMail(array $employee, string $stage): array
|
function timeErrorNotificationsBuildEmployeeMail(array $employee, string $stage): array
|
||||||
{
|
{
|
||||||
$name = trim($employee['vorname'] . ' ' . $employee['nachname']);
|
$name = trim($employee['vorname'] . ' ' . $employee['nachname']);
|
||||||
$dateList = timeErrorNotificationsFormatDateList($employee['error_dates']);
|
$dateList = timeErrorNotificationsFormatDateList($employee['error_dates']);
|
||||||
|
$trackingUrl = timeErrorNotificationsGetTrackingUrl();
|
||||||
$subject = ($stage === 'employee_day_3')
|
$subject = ($stage === 'employee_day_3')
|
||||||
? 'Erneute Erinnerung zu offenen Zeitfehlern'
|
? 'Erneute Erinnerung zu offenen Zeitfehlern'
|
||||||
: '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>'
|
$body = '<p>Hallo ' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . ',</p>'
|
||||||
. '<p>in deiner Zeiterfassung gibt es weiterhin offene Buchungsfehler.</p>'
|
. '<p>in deiner Zeiterfassung gibt es weiterhin offene Buchungsfehler.</p>'
|
||||||
. '<p><strong>Betroffene Tage:</strong> ' . htmlspecialchars($dateList, ENT_QUOTES, 'UTF-8') . '</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 [
|
return [
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
@@ -375,12 +389,14 @@ if (!function_exists('timeErrorNotificationsBuildAdminMail')) {
|
|||||||
{
|
{
|
||||||
$employeeName = trim($employee['vorname'] . ' ' . $employee['nachname']);
|
$employeeName = trim($employee['vorname'] . ' ' . $employee['nachname']);
|
||||||
$dateList = timeErrorNotificationsFormatDateList($employee['error_dates']);
|
$dateList = timeErrorNotificationsFormatDateList($employee['error_dates']);
|
||||||
|
$trackingUrl = timeErrorNotificationsGetTrackingUrl();
|
||||||
$subject = 'Eskalation: Offene Zeitfehler von ' . $employeeName;
|
$subject = 'Eskalation: Offene Zeitfehler von ' . $employeeName;
|
||||||
$body = '<p>Bei einem Mitarbeiter bestehen weiterhin offene Zeitfehler.</p>'
|
$body = '<p>Bei einem Mitarbeiter bestehen weiterhin offene Zeitfehler.</p>'
|
||||||
. '<p><strong>Mitarbeiter:</strong> ' . htmlspecialchars($employeeName, ENT_QUOTES, 'UTF-8') . '<br>'
|
. '<p><strong>Mitarbeiter:</strong> ' . htmlspecialchars($employeeName, ENT_QUOTES, 'UTF-8') . '<br>'
|
||||||
. '<strong>E-Mail:</strong> ' . htmlspecialchars($employee['email'], 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>'
|
. '<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 [
|
return [
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
|
|||||||
Reference in New Issue
Block a user