[SOLVED] Notify Users of Reply
Posted: Wed Mar 27, 2013 1:23 pm
I figured this out and wanted to share as I am sure it may help others.
This is for Version: 2.4.2 from 30th December 2012.
ISSUE: I wanted to have an option to notify all my support staff when a ticket was responded to. All my users work the same ticket pool, but once a ticket was assigned, they did not receive replies on tickets just to keep an eye out, unless they reviewed the ticket list and opened it. Also, the assigned users wanted a copy of the ticket reply.
SOLUTION: I added a check box to the ticket reply window to give them the option to copy the support team as a whole. When they reply, it sends an email to a distribution list.
Steps:
Open admin_ticket.php
Around line 1448 ( I added my option below the priority change option) AFTER
ADD
Open and edit admin_reply_ticket.php
Around line 258 AFTER
ADD
Create a new email template. Mine as you see is called new_reply_by_otherstaff.txt:
You also need a new hesklang subject in text.php. Mine is called new_reply_by_otherstaff and the label on the form is notify_all. I did not need the ticket data in the subject. It would be confusing to them since these are not tickets assigned to them, so it is generic. If you wanted this, you would need to change the code above and grab that data to include it in the notification email.
That is it! It is set to send the email by default as you see on the checkbox value. You can turn that off if you like. I hope this helps others. There is no guarantee on this, it is just an idea. Cheers
This is for Version: 2.4.2 from 30th December 2012.
ISSUE: I wanted to have an option to notify all my support staff when a ticket was responded to. All my users work the same ticket pool, but once a ticket was assigned, they did not receive replies on tickets just to keep an eye out, unless they reviewed the ticket list and opened it. Also, the assigned users wanted a copy of the ticket reply.
SOLUTION: I added a check box to the ticket reply window to give them the option to copy the support team as a whole. When they reply, it sends an email to a distribution list.
Steps:
Open admin_ticket.php
Around line 1448 ( I added my option below the priority change option) AFTER
Code: Select all
<label><input type="checkbox" name="set_priority" value="1" /> <?php echo $hesklang['change_priority']; ?> </label>
<select name="priority">
<?php echo implode('',$options); ?>
</select><br />
Code: Select all
<label><input type="checkbox" name="notify" value="1" checked="checked" /> <?php echo $hesklang['notify_all']; ?></label>
</select><br />
Open and edit admin_reply_ticket.php
Around line 258 AFTER
Code: Select all
/* Update number of replies in the users table */
$sql = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` SET `replies`=`replies`+1 WHERE `id`=".hesk_dbEscape($_SESSION['id'])." LIMIT 1";
hesk_dbQuery($sql);
/* --> Prepare reply message */
$ticket['subject'] = hesk_msgToPlain($ticket['subject'], 1, 0);
$ticket['message'] = hesk_msgToPlain($message, 1);
/* Notify the customer */
hesk_notifyCustomer('new_reply_by_staff');
Code: Select all
if ( ! empty($_POST['notify']) )
{
/* --> Prepare reply message */
$ticket['subject'] = hesk_msgToPlain($ticket['subject'], 1, 0);
$ticket['message'] = hesk_msgToPlain($message, 1);
$notify2='support@yourdomain.com';
$msg = hesk_getEmailMessage('new_reply_by_otherstaff',$ticket,1);
hesk_mail($notify2,$hesklang['new_reply_by_otherstaff'],$msg);
}
else
{
$notify = "";
}
Code: Select all
Ticket Topic: %%SUBJECT%%
----------------------------------------
Someone has updated Ticket %%TRACK_ID%% as follows:
%%MESSAGE%%
----------------------------------------
Access this ticket:
%%TRACK_URL%%
Code: Select all
$hesklang['new_reply_by_otherstaff'] = 'Support Staff Updated a Ticket';
$hesklang['notify_all']='Notify ISD of reply';