From 5babd0bf5308151e5f659788ceb5f55c9f0e33a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr> Date: Mon, 12 Jun 2023 17:18:56 +0200 Subject: [PATCH] do_not_send => redirect (cherry picked from commit bf3b52712f143f9058c10b5522f4d362550c7dcc) --- CHANGELOG | 5 +++++ src/UnicaenMail/Controller/MailController.php | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..decba0a --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,5 @@ +6.0.6 + +* Possibilité de désactiver l'envoi de mail +* "do_not_send" est renommé en "redirect" +* un nouveau paramètre "do_not_send" n'envoie pas le mail \ No newline at end of file diff --git a/src/UnicaenMail/Controller/MailController.php b/src/UnicaenMail/Controller/MailController.php index 2812188..35a9929 100644 --- a/src/UnicaenMail/Controller/MailController.php +++ b/src/UnicaenMail/Controller/MailController.php @@ -39,8 +39,10 @@ class MailController extends AbstractActionController { return ['title' => "Envoyer un mail de test", 'error' => "L'adresse mail saisie n'est pas valide."]; } $mail = $this->getMailService()->sendMail($data['mail-to'], 'Mail de test', 'Ceci est un mail de test. <br/> <hr/>Merci de ne pas en tenir compte.'); - $mail->setMotsClefs(['TEST']); - $this->getMailService()->update($mail); + if ($mail){ + $mail->setMotsClefs(['TEST']); + $this->getMailService()->update($mail); + } } return ['title' => "Envoyer un mail de test"]; } -- GitLab