Fix use same encoding for all strings in email ack of payment.

This commit is contained in:
ldestailleur
2025-08-13 19:51:27 +02:00
parent b016944824
commit 6d564c0e43
2 changed files with 12 additions and 10 deletions

View File

@@ -1709,7 +1709,9 @@ class CMailFile
//$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol; //$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol;
$out .= "Content-Type: multipart/mixed;".$this->eol2." boundary=\"".$this->mixed_boundary."\"".$this->eol2; $out .= "Content-Type: multipart/mixed;".$this->eol2." boundary=\"".$this->mixed_boundary."\"".$this->eol2;
$out .= "Content-Transfer-Encoding: 8bit".$this->eol2; // TODO Seems to be ignored. Header is 7bit once received. if (!getDolGlobalString("MAIN_EMAIL_DISABLE_ADD_CONTENT_ENCODING_8BIT")) {
$out .= "Content-Transfer-Encoding: 8bit".$this->eol2; // TODO Seems to be ignored. Header is 7bit once received.
}
dol_syslog("CMailFile::write_smtpheaders smtp_header=\n".$out, LOG_DEBUG); dol_syslog("CMailFile::write_smtpheaders smtp_header=\n".$out, LOG_DEBUG);
return $out; return $out;

View File

@@ -2103,19 +2103,19 @@ if ($ispaymentok) {
$content = ""; $content = "";
if (array_key_exists('MEM', $tmptag)) { if (array_key_exists('MEM', $tmptag)) {
$url = $urlwithroot."/adherents/subscription.php?rowid=".((int) $tmptag['MEM']); $url = $urlwithroot."/adherents/subscription.php?rowid=".((int) $tmptag['MEM']);
$content .= '<strong>'.$companylangs->trans("PaymentSubscription")."</strong><br><br>\n"; $content .= '<strong>'.$companylangs->transnoentitiesnoconv("PaymentSubscription")."</strong><br><br>\n";
$content .= $companylangs->trans("MemberId").': <strong>'.$tmptag['MEM']."</strong><br>\n"; $content .= $companylangs->transnoentitiesnoconv("MemberId").': <strong>'.$tmptag['MEM']."</strong><br>\n";
$content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n"; $content .= $companylangs->transnoentitiesnoconv("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
} elseif (array_key_exists('INV', $tmptag)) { } elseif (array_key_exists('INV', $tmptag)) {
$url = $urlwithroot."/compta/facture/card.php?id=".((int) $tmptag['INV']); $url = $urlwithroot."/compta/facture/card.php?id=".((int) $tmptag['INV']);
$content .= '<strong>'.$companylangs->trans("Payment")."</strong><br><br>\n"; $content .= '<strong>'.$companylangs->transnoentitiesnoconv("Payment")."</strong><br><br>\n";
$content .= $companylangs->trans("InvoiceId").': <strong>'.$tmptag['INV']."</strong><br>\n"; $content .= $companylangs->transnoentitiesnoconv("InvoiceId").': <strong>'.$tmptag['INV']."</strong><br>\n";
//$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n"; //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n";
$content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n"; $content .= $companylangs->transnoentitiesnoconv("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
} else { } else {
$content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n"; $content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n";
} }
$content .= $companylangs->transnoentities("PostActionAfterPayment").' : '; $content .= $companylangs->transnoentitiesnoconv("PostActionAfterPayment").' : ';
if ($ispostactionok > 0) { if ($ispostactionok > 0) {
//$topic.=' ('.$companylangs->transnoentitiesnoconv("Status").' '.$companylangs->transnoentitiesnoconv("OK").')'; //$topic.=' ('.$companylangs->transnoentitiesnoconv("Status").' '.$companylangs->transnoentitiesnoconv("OK").')';
$content .= '<span style="color: green">'.$companylangs->transnoentitiesnoconv("OK").'</span>'; $content .= '<span style="color: green">'.$companylangs->transnoentitiesnoconv("OK").'</span>';
@@ -2130,7 +2130,7 @@ if ($ispaymentok) {
$content .= ' * '.$postactionmessage.'<br>'."\n"; $content .= ' * '.$postactionmessage.'<br>'."\n";
} }
if ($ispostactionok < 0) { if ($ispostactionok < 0) {
$content .= $langs->transnoentities("ARollbackWasPerformedOnPostActions"); $content .= $langs->transnoentitiesnoconv("ARollbackWasPerformedOnPostActions");
} }
$content .= '<br>'."\n"; $content .= '<br>'."\n";
@@ -2199,7 +2199,7 @@ if ($ispaymentok) {
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox', 'stripe')); $companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox', 'stripe'));
$sendto = $sendemail; $sendto = $sendemail;
$from = getDolGlobalString('MAILING_EMAIL_FROM') ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM"); $from = getDolGlobalString('MAILING_EMAIL_FROM', getDolGlobalString("MAIN_MAIL_EMAIL_FROM"));
// Define $urlwithroot // Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file