From e4a890cc6aaaaf7294104c4bb7c44c3743d2d344 Mon Sep 17 00:00:00 2001 From: Audrius Date: Wed, 2 Sep 2026 14:15:10 +0200 Subject: [PATCH] Stop reporting a discarded duplicate message as sent sendMessage() skips storing a message that repeats the last one already on the customer thread, and sets mailAlreadySend so no notification goes out. The success branch did not look at that flag, so the customer was told the message had been sent to the team while nothing was stored and the merchant received nothing. The thread is found by the sender's email address, so this is reached by anyone writing in twice with the same text, and by a logged-in customer whose email is prefilled for them. It looks exactly like the form failing in silence. The de-duplication itself is left alone; only the message shown now reflects what happened. --- contactform.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/contactform.php b/contactform.php index 20d70e9..2db6b9d 100644 --- a/contactform.php +++ b/contactform.php @@ -666,11 +666,22 @@ public function sendMessage() } if (!count($this->context->controller->errors)) { - $this->context->controller->success[] = $this->trans( - 'Your message has been successfully sent to our team.', - [], - 'Modules.Contactform.Shop' - ); + if (!empty($mailAlreadySend)) { + // The message repeated the last one already on this thread, so nothing was stored and no + // email went out. Reporting it as sent is what makes this look like the form failing in + // silence: the merchant never receives it and the customer is told that it arrived. + $this->context->controller->success[] = $this->trans( + 'This message has already been sent to our team.', + [], + 'Modules.Contactform.Shop' + ); + } else { + $this->context->controller->success[] = $this->trans( + 'Your message has been successfully sent to our team.', + [], + 'Modules.Contactform.Shop' + ); + } } }