Fix title of emails sents on payment

This commit is contained in:
Laurent Destailleur 2022-10-18 23:28:47 +02:00
parent 391df5043b
commit 2bfc60587e

View File

@ -1289,7 +1289,7 @@ if ($ispaymentok) {
$subject = $arraydefaultmessage->topic; $subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content; $msg = $arraydefaultmessage->content;
} else { } else {
$subject = '['.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; $subject = '['.$appli.'] '.$object->ref.' - '.$outputlangs->trans("NewRegistration").']';
$msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived"); $msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived");
} }
@ -1493,7 +1493,7 @@ if ($ispaymentok) {
$subject = $arraydefaultmessage->topic; $subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content; $msg = $arraydefaultmessage->content;
} else { } else {
$subject = '['.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; $subject = '['.$appli.'] '.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']';
$msg = $outputlangs->trans("OrganizationEventPaymentOfBoothWasReceived"); $msg = $outputlangs->trans("OrganizationEventPaymentOfBoothWasReceived");
} }
@ -1542,6 +1542,14 @@ if ($ispaymentok) {
} }
} }
// Set $appli for emails title
$appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
$appli = $conf->global->MAIN_APPLICATION_TITLE;
}
if ($ispaymentok) { if ($ispaymentok) {
// Get on url call // Get on url call
$onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN;
@ -1600,19 +1608,6 @@ if ($ispaymentok) {
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Define link to login card // Define link to login card
$appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
$appli = $conf->global->MAIN_APPLICATION_TITLE;
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
}
} else {
$appli .= " ".DOL_VERSION;
}
} else {
$appli .= " ".DOL_VERSION;
}
$urlback = $_SERVER["REQUEST_URI"]; $urlback = $_SERVER["REQUEST_URI"];
$topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived");
@ -1740,21 +1735,6 @@ if ($ispaymentok) {
$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
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Define link to login card
$appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
$appli = $conf->global->MAIN_APPLICATION_TITLE;
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
}
} else {
$appli .= " ".DOL_VERSION;
}
} else {
$appli .= " ".DOL_VERSION;
}
$urlback = $_SERVER["REQUEST_URI"]; $urlback = $_SERVER["REQUEST_URI"];
$topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed");
$content = ""; $content = "";