Admin Reply Ticket email behaviour.

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
steve
Posts: 147
Joined: Tue Mar 27, 2012 9:32 pm

Admin Reply Ticket email behaviour.

Post by steve »

Hi,

I want to change the email behavior of the admin reply ticket function.

When a User replies to a ticket I want the email to skip the user and go to all administrators.

When an Administrator replies to a ticket I want the email to skip the administrator(s) and go to the email entered in the ticket.

Can anybody help me with this?

-Steve
-Steve
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Admin Reply Ticket email behaviour.

Post by Klemen »

Like in your previous question you can check for admin using $_SESSION['isadmin'] and in database query get just users with `isadmin`='1' from the database to get list of admins.

The exact code to use here would be up to you as this is out of the scope of my support.

From your questions I presume you wish to use regular staff accounts as user (customer) logins?
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
steve
Posts: 147
Joined: Tue Mar 27, 2012 9:32 pm

Re: Admin Reply Ticket email behaviour.

Post by steve »

Yes, users are being used as customer logins.

Our service department is not that big, so when a ticket is submitted it is sent to a forwarding email address within our domain. (newticket@ourdomain.com forwards to john@ourdomain.com & jane@ourdomain.com)
I got it to work the way I need it to with some help from Klemen, Thanks!

The code I used it this:

admin/admin_reply_ticket.php

Find

Code: Select all

/*** Send "New reply added" e-mail ***/

/* Setup ticket message for e-mail */
$ticket['message'] = hesk_msgToPlain($message,1);

/* Format e-mail message */
$msg = hesk_getEmailMessage('new_reply_by_staff',$ticket);

/* Send e-mail */
hesk_mail($ticket['email'],$hesklang['new_reply_staff'],$msg);
Change to

Code: Select all

/*** Send "New reply added" e-mail ***/

/* Setup ticket message for e-mail */
$ticket['message'] = hesk_msgToPlain($message,1);

/* Format e-mail message */
$msg = hesk_getEmailMessage('new_reply_by_staff',$ticket);
$msg1 = hesk_getEmailMessage('new_reply_by_customer',$ticket);

/* Send e-mail */

		    if ($_SESSION['isadmin'])
    {
	hesk_mail($ticket['email'],$hesklang['new_reply_staff'],$msg);
    }
    else
    {
	hesk_mail('newticket@ourdomain.com',$hesklang['new_reply_staff'],$msg1);
    }
    

If a user submits a reply the email is sent to a specific email address (email@mydomain.com)
If a admin submits a reply the email goes to the user who submitted the ticket.

I hope somebody else finds this useful.
-Steve
Post Reply