commit
679948e207
@ -251,11 +251,21 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create)
|
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create)
|
||||||
{
|
{
|
||||||
$sendto = '';
|
$sendto = '';
|
||||||
if (empty($user->socid) && empty($user->email)) {
|
|
||||||
$object->fetch_thirdparty();
|
//if contact selected send to email's contact else send to email's thirdparty
|
||||||
$sendto = $object->thirdparty->email;
|
|
||||||
} else {
|
$contactid = GETPOST('contactid', 'alpha');
|
||||||
$sendto = $user->email;
|
|
||||||
|
if(!empty($contactid)) {
|
||||||
|
$contact = new Contact($this->db);
|
||||||
|
$res = $contact->fetch($contactid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
|
||||||
|
$sendto = $contact->email;
|
||||||
|
} elseif (!empty($object->fk_soc)) {
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
$sendto = $object->thirdparty->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sendto) {
|
if ($sendto) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user