Created a Solution to Resend Ticket to Assigned Staff
I created a solution to resend a ticket to the assigned staff member for that ticket. This is just incase they did not receive the first email that they did not receive, or you just want to send out they email again so they have the information right in their hands.
The need for this came about because staff members are usually mobile and look at the tickets from their Blackberrys. The supervisor was looking for a way to resend the assigned staff member the ticket so they can look at it on their blackberry without having to search through old emails.
Below is my solution:
1. Add the attached file, resendticket.php, to the scp folder.
2. Add this function (code) below to the include/class.ticket.php file.
//Resend ticket to staff
function resendTicket($staffId,$message,$alertstaff=true) {
global $thisuser,$cfg;
$staff = new Staff($staffId);
//Send Notice + Message to assignee.
$sql='SELECT assigned_alert_subj,assigned_alert_body FROM '.EMAIL_TEMPLATE_TABLE.
' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($cfg->getDefaultTemplateId());
$resp=db_query($sql);
list($subj, $body)= db_fetch_row($resp);
$subj = str_replace("%ticket", $this->getExtId(),$subj);
$body = str_replace("%priority", $this->priority,$body);
$body = str_replace("%assignment", $this->subject,$body);
$body = str_replace("%additional", $this->additional,$body);
$body = str_replace("%attachmentname", $this->attachmentname,$body); //added to see attachment file_name
$body = str_replace("%ticket", $this->getExtId(),$body);
$body = str_replace("%assignee", $staff->getName(),$body);
$body = str_replace("%message", $message,$body);
$body = str_replace("%url", $cfg->getBaseUrl(),$body);
Misc:($staff->getEmail(),$subj,$body,$cfg->getAlertEmail());
//Save the message as internal note...(record).
$this->postNote('Ticket Assigned to '.$staff->getName(),$message);
return true;
return false;
}
3. Add the code below to the include/staff/viewticket.inc.php just below,
Just after this (line 135):
<tr>
<th nowrap>Last Response:</th>
<td><?=Format:($ticket->getLastResponseDate())?></td>
</tr>
Add:
<tr>
<th>Resend Ticket:<br />
<font size=1px face="Arial, Helvetica, sans-serif">Sends email to assigned staff</font></th>
<td>
<form action="resendticket.php" method="post" name="resend_email">
<input type="hidden" id="resend_ticket_id" name="resend_ticket_id" value="<?=$id?>"/>
<input type="submit" id="btnResend" name="btnResend" value="Resend Ticket" />
</form>
</td>
</tr>
I hope you like it, and its a handy tool to install in your program.
[resendticket.zip](https://forum.osticket.com/assets/files/migrated/0/cc1692e1251ff18c660bfdb31170143.zip)