2.3: Do not require customer email

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
marty
Posts: 2
Joined: Tue Mar 06, 2012 10:13 am

2.3: Do not require customer email

Post by marty »

Hi all,

I'm setting up HESK 2.3 at our company and I think it'll really suit our needs, good software, well done developer(s)!
At the moment we're so small that we do not need email integration for customers, so I'd like to know how to make HESK not require the customers email address. Is that possible?
Regards
marty
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: 2.3: Do not require customer email

Post by Klemen »

Try this:

Open file "inc/common.inc.php" in Notepad and find line 1026 that says

Code: Select all

} // END hesk_validateEmail()
A few lines ABOVE this line change (line 1019)

Code: Select all

hesk_error($error);
to

Code: Select all

return 'empty@email.com';
Then open file "inc/email_functions.inc.php" and find line 48:

Code: Select all

function hesk_mail($to,$subject,$message) {
Just BELOW this line add:

Code: Select all

if ($to == 'empty@email.com')
{
return false;
}
Not tested so make backups first and let us know if it worked for you.
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
marty
Posts: 2
Joined: Tue Mar 06, 2012 10:13 am

Re: 2.3: Do not require customer email

Post by marty »

Hi Klemen,

your proposed changes seem plausible but don't work.
Even after logging out and back in and restarting apache2 the error persists.
I tried to understand the code and came up with the following:
hesk_validateEmail needs $address, so I set the email to empty@... if it's empty:

Code: Select all

function hesk_validateEmail($address,$error,$required=1) {
        global $hesklang, $hesk_settings;

        /* Set email to empty@email.com if none is given */
        if ($address == '')
        {
        return 'empty@email.com';
        }

        if (strpos($address,"'") !== false ...
        ...
        ...
I'm not shure if that's good programming style or if it has security implications, but my gut feeling is that it's OK.
And it works as intended, btw :D

Keep up the good work!
Marty
Post Reply