I was going to impliment this on the R5 version but I got to the last step (step 4) and the code I was supposed to find did not match what I have. There are a lot of differences and I wasn't sure what needed to be changed. This is the code I currently have in /include/class.ticket.php
function postNote($title,$note,$alert=true,$poster='') {
global $thisuser,$cfg;
$sql= 'INSERT INTO '.TICKET_NOTE_TABLE.' SET created=NOW() '.
',ticket_id='.db_input($this->getId()).
',title='.db_input(Format:($title)).
',note='.db_input(Format:($note)).
',staff_id='.db_input($thisuser?$thisuser->getId()).
',source='.db_input(($poster || !$thisuser)?$poster:$thisuser->getName());
//echo $sql;
if(db_query($sql) && ($id=db_insert_id())) {
//If enabled...send alert to staff (Internal Note Alert)
if($alert && $cfg->alertONNewNote()){
$dept=$this->getDept();
if(!$dept || !($tplId=$dept->getTemplateId()))
$tplId=$cfg->getDefaultTemplateId();
$sql='SELECT note_alert_subj,note_alert_body FROM '.EMAIL_TEMPLATE_TABLE.
' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($tplId);
if(($resp=db_query($sql)) && db_num_rows($resp) && list($subj,$body)=db_fetch_row($resp)){
$body=$this->replaceTemplateVars($body);
$subj=$this->replaceTemplateVars($subj);
$body = str_replace('%note',"$title\n\n$note",$body);..............