Hallo HerrB,
ich habe nun endlich mal Zeit gefunden den von mir im November (!!!!) geposteten Fehler zu suchen. Und siehe da, ich habe den Fehler sogar gefunden.
In der Datei class.newsletter.jobs.php findet man in Zeile ~407 folgende Anweisung:
und in Zeile ~427
Das steht hier aber an der falschen Stelle!!
Hier mal die komplette Schleife ab Zeile ~374:
Code: Alles auswählen
while ($oLog = $oLogs->next())
{
$iCount++;
$oLog->set("status", "sending");
$oLog->store();
$sRcpMsgText = $sMessageText;
$sRcpMsgHTML = $sMessageHTML;
$sKey = $oLog->get("rcphash");
$sEMail = $oLog->get("rcpemail");
$bSendHTML = false;
if ($oLog->get("rcpnewstype") == 1) {
$bSendHTML = true; // Recipient accepts html newsletter
}
if (strlen($sKey) == 30) // Prevents sending without having a key
{
$sRcpMsgText = str_replace("{KEY}", $sKey, $sRcpMsgText);
$sRcpMsgText = str_replace("MAIL_MAIL", $sEMail, $sRcpMsgText);
$sRcpMsgText = str_replace("MAIL_NAME", $oLog->get("rcpname"), $sRcpMsgText);
// Replace message tags (html message)
if ($bIsHTML && $bSendHTML)
{
$sRcpMsgHTML = str_replace("{KEY}", $sKey, $sRcpMsgHTML);
$sRcpMsgHTML = str_replace("MAIL_MAIL", $sEMail, $sRcpMsgHTML);
$sRcpMsgHTML = str_replace("MAIL_NAME", $oLog->get("rcpname"), $sRcpMsgHTML);
}
if ($bPluginEnabled)
{
// Don't change name of $recipient variable as it is used in plugins!
$recipient = new Recipient;
$recipient->loadByPrimaryKey($oLog->get("idnewsrcp"));
foreach ($aPlugins as $sPlugin => $aPluginVar)
{
foreach ($aPluginVar as $sPluginVar)
{
// Replace tags in text message
$sRcpMsgText = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar), $sRcpMsgText);
// Replace tags in html message
if ($bIsHTML && $bSendHTML) {
if (function_exists("recipients_".$sPlugin."_getHTMLValue")) {
$sRcpMsgHTML = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getHTMLValue", $sPluginVar), $sRcpMsgHTML);
} else {
$sRcpMsgHTML = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar), $sRcpMsgHTML);
}
}
}
}
unset($recipient); }
$oMail = new phpmailer();
$oMail->CharSet = $sEncoding;
$oMail->IsHTML($bIsHTML && $bSendHTML);
$oMail->From = $sFrom;
$oMail->FromName = $sFromName;
$oMail->AddAddress($sEMail);
$oMail->Mailer = "mail";
$oMail->Subject = $sSubject;
if ($bIsHTML && $bSendHTML)
{
$oMail->Body = $sRcpMsgHTML;
$oMail->AltBody = $sRcpMsgText."\n\n";
} else {
$oMail->Body = $sRcpMsgText."\n\n";
}
if ($oMail->Send()) {
$oLog->set("status", "successful");
$oLog->set("sent", date("Y-m-d H:i:s"), false);
} else {
$oLog->set("status", "error (sending)");
}
} else {
$oLog->set("status", "error (key)");
}
$oLog->store();
}
Das ganze müsste man hiermit ersetzen:
Code: Alles auswählen
$recipient = new Recipient; # edit by funomat TG
while ($oLog = $oLogs->next())
{
$iCount++;
$oLog->set("status", "sending");
$oLog->store();
$sRcpMsgText = $sMessageText;
$sRcpMsgHTML = $sMessageHTML;
$sKey = $oLog->get("rcphash");
$sEMail = $oLog->get("rcpemail");
$bSendHTML = false;
if ($oLog->get("rcpnewstype") == 1) {
$bSendHTML = true; // Recipient accepts html newsletter
}
if (strlen($sKey) == 30) // Prevents sending without having a key
{
$sRcpMsgText = str_replace("{KEY}", $sKey, $sRcpMsgText);
$sRcpMsgText = str_replace("MAIL_MAIL", $sEMail, $sRcpMsgText);
$sRcpMsgText = str_replace("MAIL_NAME", $oLog->get("rcpname"), $sRcpMsgText);
// Replace message tags (html message)
if ($bIsHTML && $bSendHTML)
{
$sRcpMsgHTML = str_replace("{KEY}", $sKey, $sRcpMsgHTML);
$sRcpMsgHTML = str_replace("MAIL_MAIL", $sEMail, $sRcpMsgHTML);
$sRcpMsgHTML = str_replace("MAIL_NAME", $oLog->get("rcpname"), $sRcpMsgHTML);
}
if ($bPluginEnabled)
{
// Don't change name of $recipient variable as it is used in plugins!
// $recipient = new Recipient; # edit by funomat TG
$recipient->loadByPrimaryKey($oLog->get("idnewsrcp"));
foreach ($aPlugins as $sPlugin => $aPluginVar)
{
foreach ($aPluginVar as $sPluginVar)
{
// Replace tags in text message
$sRcpMsgText = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar), $sRcpMsgText);
// Replace tags in html message
if ($bIsHTML && $bSendHTML) {
if (function_exists("recipients_".$sPlugin."_getHTMLValue")) {
$sRcpMsgHTML = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getHTMLValue", $sPluginVar), $sRcpMsgHTML);
} else {
$sRcpMsgHTML = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar), $sRcpMsgHTML);
}
}
}
}
// unset($recipient); # edit by funomat TG
}
$oMail = new phpmailer();
$oMail->CharSet = $sEncoding;
$oMail->IsHTML($bIsHTML && $bSendHTML);
$oMail->From = $sFrom;
$oMail->FromName = $sFromName;
$oMail->AddAddress($sEMail);
$oMail->Mailer = "mail";
$oMail->Subject = $sSubject;
if ($bIsHTML && $bSendHTML)
{
$oMail->Body = $sRcpMsgHTML;
$oMail->AltBody = $sRcpMsgText."\n\n";
} else {
$oMail->Body = $sRcpMsgText."\n\n";
}
if ($oMail->Send()) {
$oLog->set("status", "successful");
$oLog->set("sent", date("Y-m-d H:i:s"), false);
} else {
$oLog->set("status", "error (sending)");
}
} else {
$oLog->set("status", "error (key)");
}
$oLog->store();
}
unset($recipient); # edit by funomat TG
Die Änderungen sind mit
edit by funomat TG gekennzeichnet.
Das selbe Problem dürfte in der 4.8.x auch auftreten, da der Code an der Stelle nicht verändert wurde.
Gruß,
funomat