Please see below latest update.
- Added a reply separator to outgoing emails to staff (ticket message updates)
- Added the strip function on the incoming mail from staff to remove the text below the separator.
- Included the ability to insert "#close" into email subject to close a ticket.
include/class.mailfetch.php
diff class.mailfetch.orig class.mailfetch.php
400c400
< if(!($ticket=Ticket:($tid, $vars)))
---
> if(!($ticket=Ticket:($tid)))
406,408c406,423
< if(!($message=$ticket->postMessage($vars, 'Email')))
< return false;
<
---
> $staffsql = 'SELECT staff_id, firstname, lastname, email FROM '.STAFF_TABLE.' WHERE email='.db_input($vars).' LIMIT 1';
> $vars = $vars;
> if(($staffres=db_query($staffsql)) && (db_num_rows($staffres) == 0)){
> if(!($message=$ticket->postMessage($vars, 'Email')))
> return false;
> } else {
> $staffvars=db_fetch_row(db_query($staffsql));
> $replyvars=Array(
> "msgId" => $ticket,
> "response" => $vars,
> "poster" => $staffvars.' '.$staffvars,
> "staffId" => $staffvars,
> "subject" => $vars,
> );
> $errors=array();
> if(!($msgid=$ticket->postReply($replyvars, $errors)))
> return false;
> }
include/class.ticket.php
diff class.ticket.orig class.ticket.php
1314a1315,1317
> if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
> $msg ="\n$tag\n\n".$msg;
>
1402a1406,1410
> //Strip quoted reply...on emailed replies
> if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()) && strpos($vars, $tag))
> if(list($msg) = split($tag, $vars))
> $vars = $msg;
>
1404a1413,1417
>
> //Check for actions in the subject
> if($vars && preg_match ("/#close/", $vars, $action)) {
> return $this->close();
> }
Have added modified files zip to this post.