diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php
index cd220a5764f..783493f375c 100644
--- a/htdocs/public/payment/paymentko.php
+++ b/htdocs/public/payment/paymentko.php
@@ -141,8 +141,13 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
$sendemail = $conf->global->ONLINE_PAYMENT_SENDEMAIL;
}
+ // Send warning of error to administrator
if ($sendemail)
{
+ $companylangs = new Translate('', $conf);
+ $companylangs->setDefaultLang($mysoc->default_lang);
+ $companylangs->loadLangs(array('main','members','bills','paypal','paybox'));
+
$from=$conf->global->MAILING_EMAIL_FROM;
$sendto=$sendemail;
@@ -160,16 +165,21 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
else $appli.=" ".DOL_VERSION;
$urlback=$_SERVER["REQUEST_URI"];
- $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed");
+ $topic='['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed");
$content="";
- $content.=$langs->transnoentitiesnoconv("ValidationOfOnlinePaymentFailed")."\n";
- $content.="\n";
- $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n";
- $content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."
\n";
- $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n";
+ $content.=''.$companylangs->transnoentitiesnoconv("ValidationOfOnlinePaymentFailed")."\n";
+
+ $content.="
\n";
+ $content.=''.$companylangs->transnoentitiesnoconv("TechnicalInformation").":
\n";
+ $content.=$companylangs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."
\n";
+ $content.=$companylangs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."
\n";
+ $content.="
\n";
$content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt;
+
+ $ishtml=dol_textishtml($content); // May contain urls
+
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
- $mailfile = new CMailFile($topic, $sendto, $from, $content);
+ $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml);
$result=$mailfile->sendfile();
if ($result)
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 3ad71487dfc..e48fc014749 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -876,7 +876,7 @@ else
elseif ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL;
elseif ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL;
- // Send an email
+ // Send warning of error to administrator
if ($sendemail)
{
$companylangs = new Translate('', $conf);
@@ -908,7 +908,7 @@ else
$content="";
$content.=''.$companylangs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."\n";
- $content.="
\n";
+ $content.="
\n";
$content.=''.$companylangs->transnoentitiesnoconv("TechnicalInformation").":
\n";
$content.=$companylangs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."
\n";
$content.=$companylangs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."
\n";