[RESOLVED]send ticket_assigned_to_you email notice to client

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
scheckc
Posts: 15
Joined: Mon Aug 15, 2011 8:59 pm

[RESOLVED]send ticket_assigned_to_you email notice to client

Post by scheckc »

Script URL: Internal
Version of script: ver 2.3 (full release)
Hosting company: City of Salina
URL of phpinfo.php: internal
URL of session_test.php: internal
What terms did you try when SEARCHING for a solution: email when assigned, notify when assigned, notify owner change

Write your message below:

Really quick question here (I hope). I am wanting to send a ticket update email to the original submitter when the tickets "owner" is changed. I initially thought that simply modifying the "ticket_assigned_to_you.txt" file to be more general, and then sending that email to the "OWNER" as well as the submitter would do the trick. However, I am not sure where to go to modify who recieves that "ticket_assigned_to_you.txt" email.

Quick finger in the right direction would be appreciated.. and no, the middle finger in an upward direction is not what I'm looking for here. :D

cheers
Last edited by scheckc on Tue Sep 20, 2011 9:09 pm, edited 1 time in total.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by Klemen »

Customer address is stored in $ticket['email'] - in assign_owner.php you could then modify

Code: Select all

hesk_mail($myuser['email']
to

Code: Select all

hesk_mail($myuser['email'].','.$ticket['email']
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
scheckc
Posts: 15
Joined: Mon Aug 15, 2011 8:59 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by scheckc »

Great!

One more quick one, where is the 'support email' address stored? I think I want to add that email address into the assign_owner.php as well.

**
After doing a little nosing around in the .php and .txt files I think I might be able to re-word this so it is easier to understand what I am trying to accomplish.

I have the Administrators email address in my HESK setup set to a distribution list I created on our exchange server and it is working great for new tickets that are created by non-users.

My management wants an email sent to this distribution list for each of the following events.

Initial submission by users(admins).
Ticket is assigned to a user.
Status of a ticket changes.

There are already notifications for these events in the system I think it is just a matter of adding the variable for the administrators email address to the "hesk_mail" line for the appropriate task.

This is the exact same thing that you helped me do in the second post above, only now I want to add the administrator email address instead of the customer email address, and I am adding it to 3 of the notices rather than just the one.

If you can point me to the files and the code string I can most likely handle it from there.

Thanks so much for your input Klemen! I smell a 6-pack coming your way after payday. :D
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by Klemen »

$hesk_settings['support_mail']

For all settings variables see file hesk_settings.inc.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
scheckc
Posts: 15
Joined: Mon Aug 15, 2011 8:59 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by scheckc »

Thanks Klemen, that did it.. One little question that I had though.

I am not sure if this is a bug or a known issue that I need to work around.

If I place the %%OWNER%% tag in the 'ticket_assign_to_you.txt' file then it always shows me the previous owner, not the current ticket owner. I have a feeling it has to do with the fact that the email is created and sent to the new ticket owner before the ticket owner is changed in the system, but that's just a guess.

Is there anyway to circumvent this without completely re-creating the wheel?
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by Klemen »

A bug indeed, thanks for pointing it out.

Paste

Code: Select all

$ticket['owner'] = $owner;
just above

Code: Select all

$msg = hesk_getEmailMessage('ticket_assigned_to_you',$ticket,1);
in admin/assign_owner.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
scheckc
Posts: 15
Joined: Mon Aug 15, 2011 8:59 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by scheckc »

That definitely worked. Thanks!

I may have found another possible bug. Could just be something on my end too.

If I go into users and set a user to not be an admin but grant them permissions manually I always get the following error when trying to set either the "Delete tickets" or "Edit ticket replies" flag.

The message is:

Code: Select all


Error:
Can't execute SQL

Please notify webmaster at myaddress@mydomain.org
All the other flags can be set on each member without any issues. I would also like to mention that even without being able to flag the "delete tickets" option with myself set to 'NO Admin' I can still delete the tickets. Bear in mind that my user profile originally started as an 'Administrator'.

oh, and also... the 6-pack is on the way! Thanks friends you have definitely earned more, but unfortunately that's all my wallet can afford right now...

Cheers.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by Klemen »

Works in my test.

Can you try enabling Debug mode in Settings > Help Desk > Features and see what error message you get?
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
scheckc
Posts: 15
Joined: Mon Aug 15, 2011 8:59 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by scheckc »

This on the delete tickets flag...

Code: Select all

Error:

Can't execute SQL: UPDATE `hesk23_users` SET `user`='scheckc', `name`='Corey Scheck', `email`='sdfsd.sc@sdsd.com, `signature`='', `categories`='28,2,3,4,1,5,16,6,7,29,8,9,30,31,32,10,11,12,50,13,14,15,47,48,20,34,35,33,21,36,37,38,39,40,41,49,42,43,44,45,46', `isadmin`='0', `heskprivileges`='can_view_tickets,can_reply_tickets,can_del_tickets,can_del_notes,can_change_cat,can_man_kb,can_man_users,can_man_cat,can_man_canned,can_man_settings,can_add_archive,can_assign_self,can_assign_others,can_view_unassigned,can_view_ass_others,can_run_reports,can_view_online' WHERE `id`=8 LIMIT 1

MySQL said:
Data too long for column 'heskprivileges' at row 1
This for edit ticket replies...

Code: Select all

Error:

Can't execute SQL: UPDATE `hesk23_users` SET `user`='scheckc', `name`='Corey Scheck', `email`='sdfsd.sc@sdsd.com', `signature`='', `categories`='28,2,3,4,1,5,16,6,7,29,8,9,30,31,32,10,11,12,50,13,14,15,47,48,20,34,35,33,21,36,37,38,39,40,41,49,42,43,44,45,46', `isadmin`='0', `heskprivileges`='can_view_tickets,can_reply_tickets,can_edit_tickets,can_del_notes,can_change_cat,can_man_kb,can_man_users,can_man_cat,can_man_canned,can_man_settings,can_add_archive,can_assign_self,can_assign_others,can_view_unassigned,can_view_ass_others,can_run_reports,can_view_online' WHERE `id`=8 LIMIT 1

MySQL said:
Data too long for column 'heskprivileges' at row 1
Last edited by scheckc on Tue Sep 20, 2011 3:54 pm, edited 1 time in total.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by Klemen »

This happens because you didn't upgrade HESK database from 2.3 BETA to 2.3, see the very first post here:
viewtopic.php?f=13&t=3663
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
scheckc
Posts: 15
Joined: Mon Aug 15, 2011 8:59 pm

Re: send ticket_assigned_to_you email notice to ticket submi

Post by scheckc »

Thanks, that did it!
Post Reply