mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 14:37:52 +00:00
fix: send mails only when at least one email address is given
This commit is contained in:
@@ -9942,6 +9942,7 @@ function adminSaveBegegnungSpielplan(): void
|
|||||||
abortWithError($db->stderr(true));
|
abortWithError($db->stderr(true));
|
||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
|
if(!empty($rows)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($mailfrom, $fromname);
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -9951,6 +9952,7 @@ function adminSaveBegegnungSpielplan(): void
|
|||||||
}
|
}
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
begegnungChanged($begegnung, $begegnung_alt, $modus, $heim_team, $gast_team, $spiele);
|
begegnungChanged($begegnung, $begegnung_alt, $modus, $heim_team, $gast_team, $spiele);
|
||||||
|
|
||||||
@@ -10277,6 +10279,7 @@ function adminBegegnungSpielplanBestaetigen(): void
|
|||||||
abortWithError($db->stderr(true));
|
abortWithError($db->stderr(true));
|
||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
|
if(!empty($rows)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($mailfrom, $fromname);
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -10285,6 +10288,7 @@ function adminBegegnungSpielplanBestaetigen(): void
|
|||||||
$mailer->addBcc($row->email);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
|
}
|
||||||
|
|
||||||
if (isJson()) {
|
if (isJson()) {
|
||||||
begegnungSpielplan();
|
begegnungSpielplan();
|
||||||
@@ -16364,6 +16368,7 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
$body = "<p>Das " . htmlentities_utf8($aktion[$terminaktion->typ]) . " des folgenden Termins wurde " . ($terminaktion->status == 0 ? ($ueberarbeiten ? "in überarbeiteter Form akzeptiert" : "akzeptiert") : "abgelehnt") . ".</p>";
|
$body = "<p>Das " . htmlentities_utf8($aktion[$terminaktion->typ]) . " des folgenden Termins wurde " . ($terminaktion->status == 0 ? ($ueberarbeiten ? "in überarbeiteter Form akzeptiert" : "akzeptiert") : "abgelehnt") . ".</p>";
|
||||||
}
|
}
|
||||||
$body .= "<table>\r\n" . $termin_beschreibung . $termin_moderationsstatus . "</table>\r\n";
|
$body .= "<table>\r\n" . $termin_beschreibung . $termin_moderationsstatus . "</table>\r\n";
|
||||||
|
if(!empty($benachrichtigung_emails)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($from, $fromName);
|
$mailer->setSender($from, $fromName);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -16372,6 +16377,7 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
foreach ($benachrichtigung_emails as $email)
|
foreach ($benachrichtigung_emails as $email)
|
||||||
$mailer->addBcc($email);
|
$mailer->addBcc($email);
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
|
}
|
||||||
|
|
||||||
$from = $app->getCfg('mailfrom');
|
$from = $app->getCfg('mailfrom');
|
||||||
$fromName = $app->getCfg('fromname');
|
$fromName = $app->getCfg('fromname');
|
||||||
@@ -16386,6 +16392,7 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
$body = "<p>Termin " . htmlentities_utf8($aktion[$terminaktion->typ]) . " abgelehnt:</p>";
|
$body = "<p>Termin " . htmlentities_utf8($aktion[$terminaktion->typ]) . " abgelehnt:</p>";
|
||||||
}
|
}
|
||||||
$body .= "<table>\r\n" . $termin_beschreibung . $termin_moderationsstatus . "</table>\r\n";
|
$body .= "<table>\r\n" . $termin_beschreibung . $termin_moderationsstatus . "</table>\r\n";
|
||||||
|
if(!empty($benachrichtigung_moderatoren_informieren)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($from, $fromName);
|
$mailer->setSender($from, $fromName);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -16394,8 +16401,10 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
foreach ($benachrichtigung_moderatoren_informieren as $email)
|
foreach ($benachrichtigung_moderatoren_informieren as $email)
|
||||||
$mailer->addBcc($email);
|
$mailer->addBcc($email);
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
|
}
|
||||||
|
|
||||||
$body .= "<p>Bitte <a href=\"" . SportsManagerURL('&task=admin_termin_details&nur_beantragte=1&id=' . $terminaktion->termin_aktion_id, -1) . "\">hier</a> klicken, um den Termin zu moderieren.</p>\r\n";
|
$body .= "<p>Bitte <a href=\"" . SportsManagerURL('&task=admin_termin_details&nur_beantragte=1&id=' . $terminaktion->termin_aktion_id, -1) . "\">hier</a> klicken, um den Termin zu moderieren.</p>\r\n";
|
||||||
|
if(!empty($benachrichtigung_moderatoren_aendern)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($from, $fromName);
|
$mailer->setSender($from, $fromName);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -16404,6 +16413,7 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
foreach ($benachrichtigung_moderatoren_aendern as $email)
|
foreach ($benachrichtigung_moderatoren_aendern as $email)
|
||||||
$mailer->addBcc($email);
|
$mailer->addBcc($email);
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4561,6 +4561,7 @@ function begegnungVerlegen(): void
|
|||||||
abortWithError($db->stderr(true));
|
abortWithError($db->stderr(true));
|
||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
|
if(!empty($rows)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($mailfrom, $fromname);
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -4569,6 +4570,7 @@ function begegnungVerlegen(): void
|
|||||||
$mailer->addBcc($row->email);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
|
}
|
||||||
|
|
||||||
begegnungVerlegenNotify($begegnung, $rows, $vorschlagendes_team_id, $heim_team, $gast_team);
|
begegnungVerlegenNotify($begegnung, $rows, $vorschlagendes_team_id, $heim_team, $gast_team);
|
||||||
|
|
||||||
@@ -4714,6 +4716,7 @@ function begegnungVerlegen(): void
|
|||||||
abortWithError($db->stderr(true));
|
abortWithError($db->stderr(true));
|
||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
|
if(!empty($rows)) {
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
$mailer->setSender($mailfrom, $fromname);
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
$mailer->setSubject($subject);
|
$mailer->setSubject($subject);
|
||||||
@@ -4722,6 +4725,7 @@ function begegnungVerlegen(): void
|
|||||||
$mailer->addBcc($row->email);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
$mailer->send();
|
$mailer->send();
|
||||||
|
}
|
||||||
|
|
||||||
if (isJson()) {
|
if (isJson()) {
|
||||||
JSON_sportsmanager::JSON([]);
|
JSON_sportsmanager::JSON([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user