Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0

This commit is contained in:
Laurent Destailleur
2024-05-02 13:24:33 +02:00
8 changed files with 37 additions and 25 deletions

View File

@@ -930,14 +930,14 @@ class Notify
// content will be sent.
$mailTemplateLabel = isset($conf->global->{$notifcode.'_TEMPLATE'}) ? $conf->global->{$notifcode.'_TEMPLATE'} : '';
$emailTemplate = null;
// Set output language
$outputlangs = $langs;
if (!empty($mailTemplateLabel)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($this->db);
$emailTemplate = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse);
}
if (!empty($mailTemplateLabel) && is_object($emailTemplate) && $emailTemplate->id > 0) {
// Set output language
$outputlangs = $langs;
if ($obj->default_lang && $obj->default_lang != $langs->defaultlang) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($obj->default_lang);