Skip to content
Snippets Groups Projects
Commit 385be007 authored by Jared Hancock's avatar Jared Hancock
Browse files

Ticket thread supports specifying `thread-type`

This allows the email system to detect something like a bounce mail and
specify that the associated message should be an internal note.
parent a31333c1
No related branches found
No related tags found
No related merge requests found
......@@ -575,6 +575,7 @@ Class ThreadEntry {
'ip' => '',
'reply_to' => $this,
);
$errors = array();
if (isset($mailinfo['attachments']))
$vars['attachments'] = $mailinfo['attachments'];
......@@ -591,7 +592,6 @@ Class ThreadEntry {
elseif ($staff_id = Staff::getIdByEmail($mailinfo['email'])) {
$vars['staffId'] = $staff_id;
$poster = Staff::lookup($staff_id);
$errors = array();
$vars['note'] = $body;
return $ticket->postNote($vars, $errors, $poster);
}
......@@ -599,6 +599,15 @@ Class ThreadEntry {
// Don't process the email -- it came FROM this system
return true;
}
// Support the mail parsing system declaring a thread-type
elseif (isset($mailinfo['thread-type'])) {
switch ($mailinfo['thread-type']) {
case 'N':
$vars['note'] = $body;
$poster = $mailinfo['email'];
return $ticket->postNote($vars, $errors, $poster);
}
}
// TODO: Consider security constraints
else {
$vars['message'] = sprintf("Received From: %s\n\n%s",
......
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