From 8393acd0366ee3408db103ba29e8686bab127f42 Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 17 Dec 2025 13:33:07 +0100 Subject: =?UTF-8?q?choix=20d'enregistrer=20ou=20non=20les=20messages=20en?= =?UTF-8?q?=20BDD,=20non=20par=20d=C3=A9faut=20dans=20EmailService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EmailService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/EmailService.php') diff --git a/src/EmailService.php b/src/EmailService.php index 8671817..5d1b2eb 100644 --- a/src/EmailService.php +++ b/src/EmailService.php @@ -11,6 +11,8 @@ use App\Entity\NodeData; class EmailService { + const KEEP_EMAILS_DEFAULT = false; + static public function send(EntityManager $entityManager, NodeData $form_data, bool $test_email, string $name = '', string $email = '', string $message = ''): bool { $mail = new PHPMailer(true); // true => exceptions @@ -64,7 +66,7 @@ class EmailService $mail->send(); // copie en BDD - if(!$test_email){ + if(!$test_email && ($form_data->getData()['keep_emails'] ?? self::KEEP_EMAILS_DEFAULT)){ $db_email = new Email($name, $email, Config::$email_dest, $message); $entityManager->persist($db_email); self::updateLastContactDate($entityManager, $email); -- cgit v1.2.3