mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
fix: replace sendMail loop with bcc loop in order to send one mail instead of way too many
This commit is contained in:
@@ -9943,9 +9943,13 @@ function adminSaveBegegnungSpielplan(): void
|
|||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$mailer->sendMail($mailfrom, $fromname, $row->email, $subject, $body);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
|
$mailer->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
begegnungChanged($begegnung, $begegnung_alt, $modus, $heim_team, $gast_team, $spiele);
|
begegnungChanged($begegnung, $begegnung_alt, $modus, $heim_team, $gast_team, $spiele);
|
||||||
@@ -10274,9 +10278,13 @@ function adminBegegnungSpielplanBestaetigen(): void
|
|||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$mailer->sendMail($mailfrom, $fromname, $row->email, $subject, $body);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
|
$mailer->send();
|
||||||
|
|
||||||
if (isJson()) {
|
if (isJson()) {
|
||||||
begegnungSpielplan();
|
begegnungSpielplan();
|
||||||
@@ -16348,12 +16356,6 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
|
|
||||||
$from = $app->getCfg('mailfrom');
|
$from = $app->getCfg('mailfrom');
|
||||||
$fromName = $app->getCfg('fromname');
|
$fromName = $app->getCfg('fromname');
|
||||||
$mode = 1;
|
|
||||||
$cc = null;
|
|
||||||
$bcc = null;
|
|
||||||
$attachment = null;
|
|
||||||
$replyTo = null;
|
|
||||||
$replyToName = null;
|
|
||||||
if ($terminaktion->status == 2) {
|
if ($terminaktion->status == 2) {
|
||||||
$subject = "Termin " . $aktion[$terminaktion->typ] . " beantragt: " . $terminaktion->bezeichnung . " am " . FormatierterTermin($terminaktion->erster_tag, $terminaktion->letzter_tag, true);
|
$subject = "Termin " . $aktion[$terminaktion->typ] . " beantragt: " . $terminaktion->bezeichnung . " am " . FormatierterTermin($terminaktion->erster_tag, $terminaktion->letzter_tag, true);
|
||||||
$body = "<p>Das " . htmlentities_utf8($aktion[$terminaktion->typ]) . " des folgenden Termins wurde beantragt und wird nun von den Moderatoren geprüft. Sobald der Termin bearbeitet wurde, wird eine E-Mail-Benachrichtigung verschickt.</p>";
|
$body = "<p>Das " . htmlentities_utf8($aktion[$terminaktion->typ]) . " des folgenden Termins wurde beantragt und wird nun von den Moderatoren geprüft. Sobald der Termin bearbeitet wurde, wird eine E-Mail-Benachrichtigung verschickt.</p>";
|
||||||
@@ -16363,17 +16365,16 @@ function termineEmailBenachrichtigung($termin_aktion_id, $ueberarbeiten = false)
|
|||||||
}
|
}
|
||||||
$body .= "<table>\r\n" . $termin_beschreibung . $termin_moderationsstatus . "</table>\r\n";
|
$body .= "<table>\r\n" . $termin_beschreibung . $termin_moderationsstatus . "</table>\r\n";
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($from, $fromName);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->isHtml(true);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($benachrichtigung_emails as $email)
|
foreach ($benachrichtigung_emails as $email)
|
||||||
$mailer->sendMail($from, $fromName, $email, $subject, $body, $mode, $cc, $bcc, $attachment, $replyTo, $replyToName);
|
$mailer->addBcc($email);
|
||||||
|
$mailer->send();
|
||||||
|
|
||||||
$from = $app->getCfg('mailfrom');
|
$from = $app->getCfg('mailfrom');
|
||||||
$fromName = $app->getCfg('fromname');
|
$fromName = $app->getCfg('fromname');
|
||||||
$mode = 1;
|
|
||||||
$cc = null;
|
|
||||||
$bcc = null;
|
|
||||||
$attachment = null;
|
|
||||||
$replyTo = null;
|
|
||||||
$replyToName = null;
|
|
||||||
if ($terminaktion->status == 2) {
|
if ($terminaktion->status == 2) {
|
||||||
$subject = "Termin " . $aktion[$terminaktion->typ] . " beantragt von " . $terminaktion->aktion_user_name . ": " . $terminaktion->bezeichnung . " am " . FormatierterTermin($terminaktion->erster_tag, $terminaktion->letzter_tag, true);
|
$subject = "Termin " . $aktion[$terminaktion->typ] . " beantragt von " . $terminaktion->aktion_user_name . ": " . $terminaktion->bezeichnung . " am " . FormatierterTermin($terminaktion->erster_tag, $terminaktion->letzter_tag, true);
|
||||||
$body = "<p>Termin " . htmlentities_utf8($aktion[$terminaktion->typ]) . " beantragt:</p>\r\n";
|
$body = "<p>Termin " . htmlentities_utf8($aktion[$terminaktion->typ]) . " beantragt:</p>\r\n";
|
||||||
@@ -16385,12 +16386,25 @@ 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";
|
||||||
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($from, $fromName);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->isHtml(true);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($benachrichtigung_moderatoren_informieren as $email)
|
foreach ($benachrichtigung_moderatoren_informieren as $email)
|
||||||
$mailer->sendMail($from, $fromName, $email, $subject, $body, $mode, $cc, $bcc, $attachment, $replyTo, $replyToName);
|
$mailer->addBcc($email);
|
||||||
|
$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";
|
||||||
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($from, $fromName);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->isHtml(true);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($benachrichtigung_moderatoren_aendern as $email)
|
foreach ($benachrichtigung_moderatoren_aendern as $email)
|
||||||
$mailer->sendMail($from, $fromName, $email, $subject, $body, $mode, $cc, $bcc, $attachment, $replyTo, $replyToName);
|
$mailer->addBcc($email);
|
||||||
|
$mailer->send();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4562,9 +4562,13 @@ function begegnungVerlegen(): void
|
|||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$mailer->sendMail($mailfrom, $fromname, $row->email, $subject, $body);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
|
$mailer->send();
|
||||||
|
|
||||||
begegnungVerlegenNotify($begegnung, $rows, $vorschlagendes_team_id, $heim_team, $gast_team);
|
begegnungVerlegenNotify($begegnung, $rows, $vorschlagendes_team_id, $heim_team, $gast_team);
|
||||||
|
|
||||||
@@ -4711,9 +4715,13 @@ function begegnungVerlegen(): void
|
|||||||
}
|
}
|
||||||
$rows = $db->loadObjectList();
|
$rows = $db->loadObjectList();
|
||||||
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
$mailer = Factory::getContainer()->get(MailerFactoryInterface::class)->createMailer();
|
||||||
|
$mailer->setSender($mailfrom, $fromname);
|
||||||
|
$mailer->setSubject($subject);
|
||||||
|
$mailer->setBody($body);
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$mailer->sendMail($mailfrom, $fromname, $row->email, $subject, $body);
|
$mailer->addBcc($row->email);
|
||||||
}
|
}
|
||||||
|
$mailer->send();
|
||||||
|
|
||||||
if (isJson()) {
|
if (isJson()) {
|
||||||
JSON_sportsmanager::JSON([]);
|
JSON_sportsmanager::JSON([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user