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/controller/ContactFormController.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/controller') diff --git a/src/controller/ContactFormController.php b/src/controller/ContactFormController.php index 01faa72..243740f 100644 --- a/src/controller/ContactFormController.php +++ b/src/controller/ContactFormController.php @@ -7,6 +7,15 @@ use Doctrine\ORM\EntityManager; class ContactFormController { + static public function keepEmails(EntityManager $entityManager, array $json): void + { + $form_data = $entityManager->find('App\Entity\NodeData', $json['id']); + $form_data->updateData('keep_emails', $json['checked'] ? true : false); + $entityManager->persist($form_data); + $entityManager->flush(); + echo json_encode(['success' => true, 'checked' => $json['checked']]); + die; + } static public function setEmailParam(EntityManager $entityManager, array $json): void { $form = new FormValidation($json, 'email_params'); -- cgit v1.2.3