Staff note on the ticket is added

Everything related to Hesk - helpdesk software

Moderator: mkoch227

hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Staff note on the ticket is added

Post 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.
Last edited by hollandsedrop on Mon Jul 16, 2012 10:16 am, edited 1 time in total.
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Post by hollandsedrop »

Thansk Klemen.

Friends can help me in this matter there?
Feuerdraht
Posts: 2
Joined: Wed Aug 19, 2009 1:56 pm

Mailout to admins on adding a new note to a ticket

Post 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
Feuerdraht
Posts: 2
Joined: Wed Aug 19, 2009 1:56 pm

Post 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 :- )
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Post by hollandsedrop »

Thanks for support Feuerdraht.

Its Perfect...
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Post by hollandsedrop »

Hi Klemen,
Consider adding this feature to the new version of that?
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Post by hollandsedrop »

Hi Klemen,

Does this feature work 2.2?
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

It's not included in Hesk, no. This is still and unofficial/unsupported add-on.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Post by hollandsedrop »

Add a note to the staff when others are not privy to. This feature is extremely important, even indispensable in.
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Re: Staff note on the ticket is added

Post by hollandsedrop »

Help this addon for 2.2 please...
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Re: Staff note on the ticket is added

Post by hollandsedrop »

Help this addon for 2.2 please...
hollandsedrop
Posts: 90
Joined: Tue Dec 30, 2008 11:29 am

Re: Staff note on the ticket is added

Post 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?
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

Re: Staff note on the ticket is added

Post 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?
- Lisa
Post Reply