Page 1 of 2
Staff note on the ticket is added
Posted: Tue Aug 11, 2009 12:03 pm
by hollandsedrop
/*************************************
Title:Hesk
Version: 2.3
Author:
Demo:
Download:
Website:
Short description:
*************************************/
Hi,
One Staff note on the ticket is added, other staffs notify email?
Thus, other staffs will be informed about.
Thanks.
Posted: Wed Aug 12, 2009 9:53 am
by Klemen
You will need to modify admin_ticket.php to do that. I can't help but you can try using e-mail code from other files (like submit_ticket.php).
Posted: Wed Aug 12, 2009 10:46 am
by hollandsedrop
Thansk Klemen.
Friends can help me in this matter there?
Mailout to admins on adding a new note to a ticket
Posted: Wed Aug 19, 2009 2:33 pm
by Feuerdraht
Hi,
looking for a possiblility to mailout to admins when a new note is added to a ticket i found this thread.
I made a solution by taking Klemens code from other files and modifying the admin_ticket.php. it is working for me...
Please be aware, that i am a php-noob and i do not garantee for anything; - )
Put the following code into your admin_ticket.php in the section /* Add a note action */ right before the header-redirect:
Code: Select all
/* Need to notify any admins? */
$admins=array();
$sql = "SELECT `email`,`isadmin`,`categories` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` WHERE `notify`='1' AND `id`!=".hesk_dbEscape($_SESSION['id']);
$result = hesk_dbQuery($sql);
while ($myuser=hesk_dbFetchAssoc($result))
{
/* Is this an administrator? */
if ($myuser['isadmin']) {$admins[]=$myuser['email']; continue;}
/* Not admin, is he allowed this category? */
$cat=substr($myuser['categories'], 0, -1);
$myuser['categories']=explode(',',$cat);
if (in_array($category['id'],$myuser['categories']))
{
$admins[]=$myuser['email']; continue;
}
}
if (count($admins)>0)
{
$trackingURL_admin=$hesk_settings['hesk_url'].'/admin/admin_ticket.php?track='.$trackingID;
/* Get ticket info */
$sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1";
$result = hesk_dbQuery($sql);
if (hesk_dbNumRows($result) != 1)
{
hesk_error($hesklang['ticket_not_found']);
}
$ticket = hesk_dbFetchAssoc($result);
$msg = hesk_getEmailMessage('new_ticketnote_staff');
$msg = str_replace('%%NAME%%',$ticket['name'],$msg);
$msg = str_replace('%%SUBJECT%%',$ticket['subject'],$msg);
$msg = str_replace('%%TRACK_ID%%',$trackingID,$msg);
$msg = str_replace('%%TRACK_URL%%',$trackingURL_admin,$msg);
$msg = str_replace('%%SITE_TITLE%%',$hesk_settings['site_title'],$msg);
$msg = str_replace('%%SITE_URL%%',$hesk_settings['site_url'],$msg);
$msg = str_replace('%%MESSAGE%%',hesk_msgToPlain($ticket['message'],1),$msg);
/* Send e-mail */
$email=implode(',',$admins);
$headers = "From: $hesk_settings[noreply_mail]\n";
$headers.= "Reply-to: $hesk_settings[noreply_mail]\n";
$headers.= "Return-Path: $hesk_settings[webmaster_mail]\n";
$headers.= "Content-type: text/plain; charset=".$hesklang['ENCODING'];
@mail($email,$hesklang['newnote'],$msg,$headers);
}
Please be aware, that i added an email-template to notify about new notes. This email-template is called "new_ticketnote_staff". You have to put a file 'new_ticketnote_staff.txt' into your lang/email folder.
To allow HESK to use this email-template i have put the name of it into the array of valid emails in the files "admin_settings_save.php" , "admin_settings.php" and "common.inc.php'.
I also added a variable $hekslang['newnote'] with the subject to my langfile.
I works fine for me. It sends emails to all admins and users who have rights in the category. The user adding the note gets no mail.
For the email-template and/or variable for the subject, who have to decide for your own... you can take all existing templates or make a new one like i did. You have to change the "new_ticketnote_staff" and "$hekslang['newnote']" in the code above to the values of your choice. If you take an existing template you dont have to add anything into the array of valid emails.
So... sorry for the long text and sorry for my bad english.
I was just thinking i d contribute to the HESK-community by explaining what i did...
BTW: Hesk rocks ! It is the best helpdesk system i found and i have looked at a lot of them ;- )
All my respects to Klemen for coding it !
The only thing i really miss is a more complex user-system and the possiblity to forward ticket to users/usergroups.
I saw, that this feature is already on the "wishlist" ;- ))
Greetings from sunny Germany
Feuerdraht
Posted: Thu Aug 20, 2009 9:32 am
by Feuerdraht
Hups,
i forgot to mention the HESK-Version i made the changes for ; -))
/*************************************
Title:Hesk
Version: 2.1
Short description:
added mailout when adding a new note to a ticket
*************************************/
@hollandsedrop: as promised i send you an email...
Greetings from sunny Germany
Feuerdraht
HESK ROCKS ! KLEMEN TOO :- )
Posted: Mon Aug 24, 2009 1:41 pm
by hollandsedrop
Thanks for support Feuerdraht.
Its Perfect...
Posted: Thu Oct 22, 2009 5:09 am
by hollandsedrop
Hi Klemen,
Consider adding this feature to the new version of that?
Posted: Fri Oct 23, 2009 12:46 pm
by Klemen
A lot of features are being considered, but I can't really say or promise which ones will be added.
Currently I have so much other work that it might be a while until 2.2. is ready.
Posted: Thu Jul 15, 2010 6:28 am
by hollandsedrop
Hi Klemen,
Does this feature work 2.2?
Posted: Thu Jul 15, 2010 3:47 pm
by Klemen
It's not included in Hesk, no. This is still and unofficial/unsupported add-on.
Posted: Mon Jul 19, 2010 5:49 am
by hollandsedrop
Add a note to the staff when others are not privy to. This feature is extremely important, even indispensable in.
Re: Staff note on the ticket is added
Posted: Tue Aug 31, 2010 9:14 am
by hollandsedrop
Help this addon for 2.2 please...
Re: Staff note on the ticket is added
Posted: Thu Mar 10, 2011 6:36 pm
by hollandsedrop
Help this addon for 2.2 please...
Re: Staff note on the ticket is added
Posted: Mon Sep 26, 2011 7:05 am
by hollandsedrop
Add a note to the staff when others are not privy to. This feature is extremely important, even indispensable in.
for 2.3 help please?
Re: Staff note on the ticket is added
Posted: Fri Sep 30, 2011 1:14 am
by Lisaweb
If you are just looking for adding notes to the staff that customers are not privy to, 2.3 already has that feature. You can find it located at the bottom of the main ticket box. (It doesn't send out an email to the staff updating them, however, if that is what you are looking for.)
hollandsedrop wrote:Add a note to the staff when others are not privy to. This feature is extremely important, even indispensable in.
for 2.3 help please?