Merge pull request #4728 from atm-ph/fix_send_mail_from_thirdparty
Fix can't send mail to thirdparty contact if no mail defined on thirdparty card
This commit is contained in:
commit
a73b53ff9c
@ -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>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user