Fix selection of email template

This commit is contained in:
Laurent Destailleur 2023-04-25 21:30:00 +02:00
parent 388ba8f399
commit 40ed102dfe

View File

@ -418,7 +418,7 @@ class FormMail extends Form
$model_id = $this->param["models_id"];
}
$arraydefaultmessage = $this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, ($model_id > 0 ? $model_id : 0), 1, '', 1); // If $model_id is empty, preselect the first one
$arraydefaultmessage = $this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id, 1, '', ($model_id > 0 ? -1 : 1)); // If $model_id is empty, preselect the first one
}
// Define list of attached files