Page 1 of 1

Email Notifications

Posted: Thu May 07, 2009 4:50 pm
by davwat
Script URL:
Version of script:2.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

In our case we have more than one user making replies to the same ticket.

When a user has replied to a ticket an email notification is sent to the submitter. Is it possible to modify the code a little so an email notification is also sent to other users so they are aware that a reply has been made by another user.

Have good Day!
Dave Watkins

Posted: Thu May 07, 2009 5:50 pm
by Klemen
Haven't tested it, but try opening admin_reply_ticket.php in Notepad and just above this line

Code: Select all

/* Send the e-mail */
paste this

Code: Select all

/* Need to notify other admins? */
$admins=array();
$sql = "SELECT `email`,`isadmin`,`categories` FROM `".$hesk_settings['db_pfix']."users` WHERE `notify`='1' AND `id` != $_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,$myuser['categories']))
    {
        $admins[]=$myuser['email']; continue;
    }
}
if (count($admins)>0)
{
	$orig_email .= ',' . implode(',',$admins);
}

Posted: Fri May 08, 2009 3:39 pm
by davwat
Klemen

Thanks a lot for giving me the code. It works fine as long as the other users receiving the email have full access to all the admin features but not with those users that have limited access.

As the message that gets sent to the users is the message that is intended for the submitter, the users will have to be careful and remember not to reply to any of the tickets by going to the support ticket direct from the link in the email as they will need to log in to reply otherwise they will be answering in the submitters name.


Have Good Day!
Dave Watkins