From 34f4ad5c5d95eb680b9bc36d0cac0fc7cd573f63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Dec 2025 18:22:21 +0100 Subject: [PATCH] FIX Selection of email when prefilled from a template --- htdocs/core/class/html.formmail.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 5388e1f9ecc..0a8a44ac098 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -723,7 +723,7 @@ class FormMail extends Form if (!empty($arraydefaultmessage->email_from)) { $templatemailfrom = ' <'.$arraydefaultmessage->email_from.'>'; - $liste['from_template_'.GETPOST('modelmailselected')] = array('label' => $templatemailfrom, 'data-html' => $templatemailfrom); + $liste['from_template_'.$arraydefaultmessage->id] = array('label' => $templatemailfrom, 'data-html' => $templatemailfrom); } // Also add robot email @@ -782,7 +782,7 @@ class FormMail extends Form $liste[$key]['data-html'] = str_replace(array('__LTCHAR__', '__GTCHAR__'), array('(', ')'), $liste[$key]['data-html']); } } - $out .= ' '.$form->selectarray('fromtype', $liste, empty($arraydefaultmessage->email_from) ? $this->fromtype : 'from_template_'.GETPOST('modelmailselected'), 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 1, '', $disablebademails); + $out .= ' '.$form->selectarray('fromtype', $liste, empty($arraydefaultmessage->email_from) ? $this->fromtype : 'from_template_'.$arraydefaultmessage->id, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 1, '', $disablebademails); } $out .= "\n";