From 54bd44e14af1744946b0d8d8148080b84be49422 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Tue, 20 Dec 2022 11:43:42 +0100 Subject: [PATCH] NEW : notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR) --- htdocs/ticket/class/ticket.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 2a3160b3b67..10c0541c168 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2449,6 +2449,16 @@ class Ticket extends CommonObject $assigned_user_dont_have_email = $assigned_user->getFullName($langs); } } + if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR)) { + $contactList = $object->liste_contact(-1, 'internal', 0, 'CONTRIBUTOR'); + if (is_array($contactList)) { + foreach ($contactList as $contactArray) { + if (!empty($contactArray['email'])) { + $sendto[] = dolGetFirstLastname($contactArray['firstname'], $contactArray['lastname']) . " <" . $contactArray['email'] . ">"; + } + } + } + } if (empty($sendto)) { if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL)) { $sendto[] = $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL;