From 7d1b94f515673f840795f3db566944ab86af87df Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 28 Feb 2020 15:00:28 +0100 Subject: [PATCH] [9.2.23] Fix reply to email --- core/core.php | 2 +- module/form/form.php | 8 +++++--- module/form/view/config/config.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) 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 @@
- (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']), 'help' => 'Cette option permet de réponse drectement à l\'expéditeur du message si celui-ci a indiqué un email valide.' ]); ?>