diff --git a/core/core.php b/core/core.php index dcd5e3c4..89cc61fc 100644 --- a/core/core.php +++ b/core/core.php @@ -738,7 +738,7 @@ class common { * @param string $content Contenu * @return bool */ - public function sendMail($to, $subject, $content, $replyTo = '') { + public function sendMail($to, $subject, $content, $replyTo = null) { // Utilisation de PHPMailer version 6.0.6 require_once "core/vendor/phpmailer/phpmailer.php"; require_once "core/vendor/phpmailer/exception.php"; diff --git a/module/form/form.php b/module/form/form.php index 4e3e0b7a..eb08d029 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -316,10 +316,12 @@ class form extends common { $filter = helper::FILTER_STRING_SHORT; } $value = $this->getInput('formInput[' . $index . ']', $filter, $input['required']) === true ? 'X' : $this->getInput('formInput[' . $index . ']', $filter, $input['required']); - // Champ reply ajouté au mail - if ($this->getData(['module', $this->getUrl(0), 'config', 'replyto']) === true && $filter === helper::FILTER_MAIL) { + // premier chalmp email ajouté au mail en reply si option active + if ($this->getData(['module', $this->getUrl(0), 'config', 'replyto']) === true && + $input['type'] === 'mail' && + $replyTo !== null) { $replyTo = $value; - } + } // Préparation des données pour la création dans la base $data[$this->getData(['module', $this->getUrl(0), 'input', $index, 'name'])] = $value; // Préparation des données pour le mail diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index 00cfc33e..f503de57 100644 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -121,7 +121,7 @@