Page 1 of 1

Ticket customized message text based on category selected

Posted: Wed Feb 24, 2021 12:25 am
by ghoho
Script URL: localhost test
Version of script: 3.1.2
Hosting company: local test
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: hesk template

Write your message below:

Dears,

Is it possible to pre-fill the message field (on index.php?a=add) automatically based on the category previously selected by the user ?
So for each category I want the message field pre-written with a customized text.

Edit: I tried template->ticket but it only seem to work on tickets created on the admin panel. I need something like this but on the client side.

Thank you all

Re: Ticket customized message text based on category selected

Posted: Wed Feb 24, 2021 11:30 am
by Klemen
Not based on category selection, but you can send the default message via a parameter:
https://www.hesk.com/knowledgebase/?article=83

Maybe create custom links on your website for categories and include a different message for each?

Re: Ticket customized message text based on category selected

Posted: Thu Feb 25, 2021 12:28 am
by ghoho
Thank you Klemen

I just modified the category-select.php and added &message on the link with a switch condition based on the category ID.
Not ideal, but fixed my problem.

In case anyone needs this in the future, on "category-select.php" line 118 (after the foreach)

Code: Select all

<a href="index.php?a=add&amp;category=<?php echo $k; ?>&message=<?php switch($k):
                                case 1: echo 'TEXT 1';
                                        break;
                                case 2: echo 'TEXT 2';
                                        break;
                                case 3: echo 'TEXT 3';
                                        break;
                                default: echo ' ';
                                        break;
                                endswitch;?>
                            " class="navlink <?php if ($category_count > 8) echo "navlink-condensed"; ?>">

Re: Ticket customized message text based on category selected

Posted: Thu Feb 25, 2021 8:47 am
by Klemen
Great, thanks for sharing!