From 2fe9acb01cb3e70f77955376deb83aca9dc98de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Meyer?= Date: Mon, 22 Dec 2025 10:16:09 +0100 Subject: [PATCH] =?UTF-8?q?=C3=84nderungen=20gecheckt,=20Absender=20in=20j?= =?UTF-8?q?oomlamail=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/com_sportsmanager/admin.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/structure/components/com_sportsmanager/admin.php b/src/structure/components/com_sportsmanager/admin.php index f41868e..265fa29 100644 --- a/src/structure/components/com_sportsmanager/admin.php +++ b/src/structure/components/com_sportsmanager/admin.php @@ -99,7 +99,7 @@ function renderTemplate($template, $vars = []): string $template ); - // 3. Einzelne Variablen ersetzen + // 3. Einzelne Variablen ersetzen (muss immer am Ende bleiben!!!) return preg_replace_callback( '/\{([A-Z0-9_]+)\}/i', function($m) use ($vars) { @@ -6143,6 +6143,7 @@ function adminEditSaison(): void function adminOrdnungsstrafeMailen(): void { + $db = getDatabase(); $jInput = Factory::getContainer()->get(SiteApplication::class)->input; $id = $jInput->get('id', 0, 'INT'); @@ -6237,8 +6238,12 @@ function sendJoomlaMail(): void $subject = $db->escape(trim($jInput->get('betreff', '', 'RAW'))); $body = nl2br(trim($jInput->get('nachricht', '', 'RAW'))); + $user_id = isExternalDatabase() ? 0 : (isJson() ? getUserID() : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id); + $query = "SELECT name, email FROM #__users WHERE id = '$user_id';"; + $absender = loadObjectList($db, $query); + // Joomla From-Adresse aus Konfiguration - $fromName = 'STFV'; + $fromName = $absender[0]->name; $fromEmail = $app->getCfg('mailfrom'); // Mailer erstellen über FactoryInterface @@ -6272,7 +6277,10 @@ function sendJoomlaMail(): void $mailer->addBcc($recipient); } } - + + //Checkmail für Absender + $mailer->addBcc($absender[0]->email); + // Betreff und Body $mailer->setSubject($subject); $mailer->setBody($body);