Page 1 of 1

How to disable email to registered users

Posted: Fri Apr 17, 2009 11:23 am
by limcc
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:

Write your message below:

I would like to know how to dissable all email alerts to all the registered users (the helpdesk folks) but only allow email alerts to an admin (shared Helpesk account) ? I would like to channel all email to a single email address.

Posted: Fri Apr 17, 2009 1:15 pm
by Klemen
Try changig this code in submit_ticket.php and reply_ticket.php

Code: Select all

$sql = "SELECT `email`,`isadmin`,`categories` FROM `".$hesk_settings['db_pfix']."users` WHERE `notify`='1'";
$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;
    }
}
to

Code: Select all

$sql = "SELECT `email` FROM `".$hesk_settings['db_pfix']."users` WHERE `notify`='1' AND `isadmin`='1'";
$result = hesk_dbQuery($sql);
while ($myuser=hesk_dbFetchAssoc($result))
{
    /* Is this an administrator? */
    $admins[]=$myuser['email'];
}
Didn't test it though so make a backup of old files before editing.