Multiple websites on one Hesk

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
rudni4ok
Posts: 1
Joined: Fri Jan 21, 2022 7:21 pm

Multiple websites on one Hesk

Post by rudni4ok »

My company has 3 products that are hosted on 3 separate websites.
Is there a way to have 3 frontends staged as "ProductName", but have only one backend so support staff has no need to re-login on each site to see active tickets?

I.e. a user on ProductA.com website creates ticket, that goes to the common admin area and is marked as ProductA ticket.
A user on ProductB.com website creates ticket, that goes to the same common admin area and is marked as ProductB ticket.
Wat the support staff logins to admin area, he sees ProductA and ProductB tickets. Answers on them. And the user get replies from the appropriate email address (support@ProductA.com or support@ ProductB.com).
Durzo
Posts: 5
Joined: Fri Jan 21, 2022 7:16 pm

Re: Multiple websites on one Hesk

Post by Durzo »

I am not a HESK staff and also very new to HESK so take my suggestion with a grain of salt.

I don't know if this is a feature that exists within the HESK platform but it should be achieved fairly simply with some script modifications.

-- On each of the 3 product pages point the helpdesk to use the same database. Presumably you would just pick one to be the "admin" page.
-- Modify the SQL script that saves the new ticket to append (product name) to the beginning of the ticket name
-- Modify the script that sends the response with a conditional to check the subject of the ticket for the appended product name (REGEX?) and have it select the appropriate email to send the email from.


This should give the effect that you are looking for :)

Edit:
At a glace it looks like the files you would need to look at to change the email response are found in the "admin" folder of your HESK installation and "submit_ticket.php" is in the root folder. They also seem to be fairly well commented (always a blessing) so you should be able to find exactly what you need quickly.
Durzo
Posts: 5
Joined: Fri Jan 21, 2022 7:16 pm

Re: Multiple websites on one Hesk

Post by Durzo »

I did a little additional digging for you (I'm bored lol)
---------------------------------------------------------------------------------------------------------------------------------------------------
Tickets Sharing a Database This is a little tricky, please stay with me

Creating the tickets to the same shared database took a little bit to find what I was looking for.

-- In the flie "{root}\inc\posting_functions.inc.php" You will find the function hesk_newTicket This is the script that actually creates the new ticket in the database.

-- In the file "{root}\inc\database_mysqli.inc.php" You will find the function hesk_dbQuery This function is used by hesk_newTicket above function to execute the query.

-- In the file "{root}\inc\database.inc.php" You will find the function hesk_dbConnect This function is used by hesk_dbQuery above function to execute the query.

-- In the file "{root}\hesk_settings.inc.php" You will find the database connection settings that HESK uses.


Now, here is how you can use these functions to make all 3 products post tickets to the same database. You will need to do this for each of the 3 webpages for the 3 products. Using this method you should allow each of them to still use their own separate databases for all other purposes such as storing knowledgebase articles while sharing a ticket database.

1: Add to "hesk_settings.inc.php" another block of settings to store the ticket database information. This should be the same database on all 3 (or more) products. You can simply pick one of the 3 or another HESK installation entirely to point this to.
$hesk_settings['db_host']='localhost';
$hesk_settings['ticket_db_name']='hesk';
$hesk_settings['ticket_db_user']='test';
$hesk_settings['ticket_db_pass']='test';
$hesk_settings['ticket_db_pfix']='hesk_';
2: Make a copy of hesk_dbConnect called something like hesk_ticketdbConnect and have it point to the ticket database info you set in step 1.

3: Make a copy of hesk_dbQuery called something like hesk_ticketdbQuery and point it to use the function you created in step 2.

4: Modify the function hesk_newTicket to use the function you created in step 3.



---------------------------------------------------------------------------------------------------------------------------------------------------
New Ticket Subject Modification

In the file "{root}\inc\posting_functions.inc.php" You will find the function hesk_newTicket that handles ticket creation.

I would simply edit this on each of the product pages to concatenate something like "(Product) Support -- " to the beginning of the ticket name.



---------------------------------------------------------------------------------------------------------------------------------------------------
Email Responses

On the shared ticket Installation of HESK, in the file "{root}\hesk_settings.inc.php" you will find $hesk_settings['noreply_mail']. This is where the default response email is stored.

I probably wouldn't mess with the original entry here as I am not sure where else it is used, but for your purposes you could add 3 additional settings:
$hesk_settings['noreply_mail_product1']
$hesk_settings['noreply_mail_product2']
$hesk_settings['noreply_mail_product3']

On the shared ticket Installation of HESK, in the file "{root}\inc\email_functions.inc.php" you will find hesk_mail. This is the function that seems to send all of the automated responses.

Use REGEX to check the title of the email (that from the looks of the function hesk_getEmailSubject on line 403 should contain the ticket name) for the product name to determine where it should come from. Once you have determined which email it should come from simply point it to the appropriate setting above under the comment "// Setup "name <email>" for headers".




This seems to me that it should work but I have not tested it.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Multiple websites on one Hesk

Post by Klemen »

There is no built-in way to support that in Hesk.

What I usually recommend is creating a common company help desk (companyhelpdesk.com instead of support.productA.com for example) and a category for each product. I understand that may not be possible or preferred in many cases, but it's the only "official" way to do it.

You can try to hack your help desk with the help of a PHP developer - thank you @Druzo for some ideas and pointers! Just keep in mind that this is something you will need to develop and maintain yourself.
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