diff --git a/include/api.tickets.php b/include/api.tickets.php index 7268d0ffabaacedf3707c9a50071a955b17809e0..80cdd1f10d873d2c7b16da863ceb9e0b5a1030d9 100644 --- a/include/api.tickets.php +++ b/include/api.tickets.php @@ -38,7 +38,7 @@ class TicketApiController extends ApiController { if(!strcasecmp($format, 'email')) { $supported = array_merge($supported, array('header', 'mid', - 'emailId', 'ticketId', 'reply-to', 'reply-to-name', + 'emailId', 'to-email-id', 'ticketId', 'reply-to', 'reply-to-name', 'in-reply-to', 'references', 'thread-type', 'recipients' => array('*' => array('name', 'email', 'source')) )); diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php index 14cdb9e1db0054120d6de9d1334376939ad04b5e..510de3e8354c64e767a860bfea11bb038891f10b 100644 --- a/include/class.mailfetch.php +++ b/include/class.mailfetch.php @@ -604,8 +604,9 @@ class MailFetcher { $vars = $mailinfo; $vars['name'] = $mailinfo['name']; - $vars['subject'] = $mailinfo['subject'] ? $mailinfo['subject'] : '[No Subject]'; - $vars['emailId'] = $mailinfo['emailId'] ? $mailinfo['emailId'] : $this->getEmailId(); + $vars['subject'] = $mailinfo['subject'] ?: '[No Subject]'; + $vars['emailId'] = $mailinfo['emailId'] ?: $this->getEmailId(); + $vars['to-email-id'] = $mailinfo['emailId'] ?: 0; if ($this->isBounceNotice($mid)) { // Fetch the original References and assign to 'references' diff --git a/include/class.mailparse.php b/include/class.mailparse.php index 81a4353ac3480ef0f0f42585b98425f4e1017031..33999522ed0a63e307b46aeec9356388a15b0637 100644 --- a/include/class.mailparse.php +++ b/include/class.mailparse.php @@ -596,6 +596,7 @@ class EmailDataParser { $data['header'] = $parser->getHeader(); $data['mid'] = $parser->getMessageId(); $data['priorityId'] = $parser->getPriority(); + $data['to-email-id'] = $data['emailId']; if (($replyto = $parser->getReplyTo())) { $replyto = $replyto[0]; diff --git a/include/class.ticket.php b/include/class.ticket.php index 50ad197c92ca1e8b7b85b26cf0d816f3495e7be2..ee243100f10810c74a7c17937e95023580194bbe 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1525,7 +1525,7 @@ class Ticket { //Add email recipients as collaborators... if ($vars['recipients'] //Only add if we have a matched local address - && $vars['emailId']) { + && $vars['to-email-id']) { //New collaborators added by other collaborators are disable -- // requires staff approval. $info = array(