From da7679dfda069a69040d904cee968f0c3feec87d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 26 Dec 2024 11:15:22 +0100 Subject: [PATCH] FIX #28702 --- htdocs/core/actions_sendmails.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 55e97603bc5..326d7c795c9 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -203,6 +203,15 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO } elseif ($val == 'contact') { // Key selected means current contact $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; $sendtoid[] = $contact->id; + } elseif ($val && $object->element == 'project' && empty($object->socid)) { // $val is the Id of a contact + $contact = new Contact($db); + $ret = $contact->fetch((int) $val); + if ($ret > 0 && !empty($contact->socid)) { + $thirdparty = new Societe($db); + $thirdparty->fetch($contact->socid); + $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); + $sendtoid[] = ((int) $val); + } } elseif ($val) { // $val is the Id of a contact $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = ((int) $val);