If you review the code I have posted for the MOD regarding Closed Ticket Alerts - you should be able to do what you want. Use the function postReply and which includes alerting assignee in that function. Warning in advance that it is a large modification but works great. IMHO.
http://osticket.com/forums/showthread.php?t=13764(http://osticket.com/forums/showthread.php?t=13764)
On the other hand - it just be your template because this functionality was greatly improved in 1.7ST. There are three alerts for an assignee - the first alert is the Assignment Alert - that tells them that they have been assigned a ticket and posts the comments from the manager - here is my template:
Do not reply to this email.
To view/respond to the ticket, please login to the support ticket system.
%{ticket.staff_link}
%{assignee},
%{assigner} has assigned ticket #%{ticket.number} to you!
----------------------
Name: %{ticket.name}
Email: %{ticket.email}
Dept: %{ticket.dept.name}
Status: %{ticket.status}
Assigned: %{ticket.assigned}
Assigned By: %{assigner}
Message: %{comments}
----------------------
Then there is the postMessage function that is used when the customer replies to their own ticket. I believe that already has a proper check for '$this->isAssigned()'
Here is my check in that function
//Insert message from client
function postMessage($vars, $origin='', $alerts=true) {
global $cfg;
//Strip quoted reply...on emailed replies
if(!strcasecmp($origin, 'Email')
&& $cfg->stripQuotedReply()
&& ($tag=$cfg->getReplySeparator()) && strpos($vars, $tag))
if(list($msg) = split($tag, $vars))
$vars = $msg;
if($vars)
$vars = $vars;
elseif(!$vars && $_SERVER)
$vars = $_SERVER;
$errors = array();
if(!($message = $this->getThread()->addMessage($vars, $errors)))
return null;
$this->setLastMsgId($message->getId());
if (isset($vars))
$message->saveEmailInfo($vars);
if(!$alerts) return $message; //Our work is done...
$autorespond = true;
if ($autorespond && $message->isAutoResponse())
$autorespond=false;
$this->onMessage($autorespond); //must be called b4 sending alerts to staff.
$dept = $this->getDept();
if(!$dept || !($tpl = $dept->getTemplate()))
$tpl= $cfg->getDefaultTemplate();
if(!($email=$cfg->getAlertEmail()))
$email =$cfg->getDefaultEmail();
//If enabled...send alert to staff (New Message Alert)
if($cfg->alertONNewMessage() && $tpl && $email && ($msg=$tpl->getNewMessageAlertMsgTemplate())) {
$msg = $this->replaceVars($msg, array('message' => $message));
//Build list of recipients and fire the alerts.
$recipients=array();
//Last respondent.
if($cfg->alertLastRespondentONNewMessage() || $cfg->alertAssignedONNewMessage())
$recipients=$this->getLastRespondent();
//Assigned staff if any...could be the last respondent
if($this->isAssigned() && ($staff=$this->getStaff()))
$recipients=$staff;
//Dept manager
if($cfg->alertDeptManagerONNewMessage() && $dept && ($manager=$dept->getManager()))
$recipients=$manager;
//Sturg2013 - Only alerts dept members if the ticket is NOT assigned.
if($cfg->alertDeptMembersONNewMessage() && !$this->isAssigned() && !$this->isClosed()) {
if(($members=$dept->getMembers()))
$recipients=array_merge($recipients, $members);
}
$sentlist=array(); //I know it sucks...but..it works.
foreach( $recipients as $k=>$staff) {
if(!$staff || !$staff->getEmail() || !$staff->isAvailable() || in_array($staff->getEmail(), $sentlist)) continue;
$alert = str_replace('%{recipient}', $staff->getFirstName(), $msg);
$email->sendAlert($staff->getEmail(), $msg, $alert);
$sentlist = $staff->getEmail();
}
}
return $message;
}
And Third there is the function postReply() alert that the Assignee gets when staff may reply. I have my modified my osTicket set up so that if a ticket is assigned - and someone from the dept replies OTHER than the assignee - the assignee gets an update. I choose not to update the assignee via email if the assignee is the one who is answering - that is redundant.
That check is in the code / from the link that I provided in my previous answer.
Hope it helps.