diff --git a/core/components/tickets/model/tickets/ticketqueue.class.php b/core/components/tickets/model/tickets/ticketqueue.class.php index 0bf7509d..af941f78 100644 --- a/core/components/tickets/model/tickets/ticketqueue.class.php +++ b/core/components/tickets/model/tickets/ticketqueue.class.php @@ -24,14 +24,15 @@ public function Send() $this->xpdo->getOption('tickets.mail_from_name', null, $this->xpdo->getOption('site_name'), true) ); - if ($user = $this->getOne('User')) { - $profile = $user->getOne('Profile'); - if (!$user->get('active') || $profile->get('blocked')) { - return 'This user is not active.'; + $email = $this->get('email'); + if (empty($email)) { + if ($user = $this->getOne('User')) { + $profile = $user->getOne('Profile'); + if (!$user->get('active') || $profile->get('blocked')) { + return 'This user is not active.'; + } + $email = $profile->get('email'); } - $email = $profile->get('email'); - } else { - $email = $this->get('email'); } if (empty($email)) { @@ -52,4 +53,4 @@ public function Send() return true; } -} \ No newline at end of file +}