How to disable email to registered users

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
limcc
Posts: 4
Joined: Tue Mar 31, 2009 12:32 pm

How to disable email to registered users

Post 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.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
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
Post Reply