Skip to content
Snippets Groups Projects
Commit a73b53ff authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

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
parents 83ababee e03f4b4d
No related branches found
No related tags found
No related merge requests found
......@@ -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.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendMail').'</a></div>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment