diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 4bad452110bbf6175efea9d714d4cf4f37c1fda2..76a2c9486360b7fa22b6c3a8933c5f5b8be58805 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -2366,7 +2366,18 @@ else $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - if (! empty($object->email)) + $at_least_one_email_contact = false; + $TContact = $object->contact_array_objects(); + foreach ($TContact as &$contact) + { + if (!empty($contact->email)) + { + $at_least_one_email_contact = true; + break; + } + } + + if (! empty($object->email) || $at_least_one_email_contact) { $langs->load("mails"); print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendMail').'</a></div>';