From 8156fbfea3f27dad2df548f63771f3d84c2dbc8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Thu, 4 Apr 2024 11:44:22 +0200 Subject: [PATCH] FIX: Ticket new message notification sent twice --- htdocs/ticket/class/ticket.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 72bba5e2b1a..bc18e34ffe8 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2572,10 +2572,9 @@ class Ticket extends CommonObject continue; } - if ($info_sendto['email'] != '') { - if (!empty($info_sendto['email'])) { - $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">"; - } + // We check if the email address is not the assignee's address to prevent notification from being sent twice + if (!empty($info_sendto['email']) && $assigned_user->email != $info_sendto['email']) { + $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">"; } }