Ok this isn't as nice as my normal MODs, its a bit clunky since its all statically written but it should do the trick nonetheless.
Purpose: When transferring a ticket to another department, the new department will receive an email alerting them to the assignment.
include/class.ticket.php
Inside the function transfer, under 'global $cfg;' Add the following:
$sql = 'SELECT email,dept_name FROM ost_email LEFT JOIN ost_department on ost_email.email_id=ost_department.email_id WHERE ost_department.dept_id='.$deptId;
print $sql;
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "Department email is " .$row;
$ticketNumber=$this->getId();
$to = $row;
$deptName = $row;
$subject = "Ticket Assigned";
$message = "$deptName,\n\nTicket #$ticketNumber has been assigned to you.\n\nhttp://YOUR_DOMAIN.EXT/scp/tickets.php?id=$ticketNumber";
$headers = "From: FROM_EMAIL@YOUR_DOMAIN\r\n";
$headers .= "Reply-To: no-reply@YOUR_DOMAIN\r\n";
$headers .= "X-Mailer: PHP\" . phpversion() . \"\r\n";
mail($to, $subject, $message, $headers);
}
If there is enough desire for it I may some day add it into the template database for emails and such but right now this set in there statically was enough for me.
http://sudobash.net/?p=930(http://sudobash.net/?p=930) for further comments as they come in.