mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
Änderungen gecheckt, Absender in joomlamail hinzugefügt.
This commit is contained in:
@@ -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
|
||||
@@ -6273,6 +6278,9 @@ function sendJoomlaMail(): void
|
||||
}
|
||||
}
|
||||
|
||||
//Checkmail für Absender
|
||||
$mailer->addBcc($absender[0]->email);
|
||||
|
||||
// Betreff und Body
|
||||
$mailer->setSubject($subject);
|
||||
$mailer->setBody($body);
|
||||
|
||||
Reference in New Issue
Block a user