1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Parsing http://website/index.php?/Tickets/Submit/RenderForm/4 with SUBJECT (need help)

Discussion in 'Developing, APIs and extending' started by sniper, Aug 29, 2012.

  1. sniper

    sniper Established Member


    In V3, I was able to Parse the URL and was able to prefill the SUBJECT of an email from the URL

    It used to be like this


    As you can see from the example above, it would go straight to Department ID 3, step 1, and fill out the subject with the text after Subject= "texthere"

    In V4. I have figured out you can go straight to a department with


    which goes to department 4

    But I am looking for


    So that when the above URL is used

    It will go straight to Department #4, and fill out the SUBJECT with the text after "subject="

    can anyone help with the coding to do this and where?

    I find this useful because I am able to fill out the subject with a Dynamic text string on my web pages, and find out what the customer is emailing about, the page name, or product #. This saves a lot of time.

    Can anyone help?
  2. Gary McGrath

    Gary McGrath Staff Member

    Hi there,

    This can be done, but it will require editing the base code to pull through your extra values, I will walk you through an example

    The URL we will be using on the client side is:


    To get this pulling though, first we need to edit a file detailed below

    Kayako version: 4.50.00
    file name:class.Controller_Submit.php
    location: __apps\tickets\client

    Near line 143, you will find this:

     public function RenderForm($_departmentID = false) {
    We need to add our new ticketsubject variable to this, like so:

     public function RenderForm($_departmentID = false, $_miskValue = '') {
    Then we need to bring that new variable into our template, near like 177, you will find this:

    $this->Template->Assign('_promptTicketPriority', false);
    We need to add a new assign for our variable, so just above that line, add this:

            $this->Template->Assign('_miskValue', $_miskValue);
    Ok, thats the end of the code changes, we now need to edit our template to use the new value like so:

    find this line in the submitticket template:

    <input name="ticketsubject" type="text" size="45" class="swifttextwide" id="ticketsubject" value="<{$_ticketSubject}>" />
    And change it to use our new variable instead:

    <input name="ticketsubject" type="text" size="45" class="swifttextwide" id="ticketsubject" value="<{$_miskValue}>" />
    you could also change the input to use the "hidden" tag, so the end user does not even see the subject box at all, but in that case, you would always have to ensure the subject contained something, else users would be unable to sumbit tickets. ( to do that, right at the top on the public function where we have $_miskValue = '', you would just put something in it by default, e.g. $_miskValue = 'n/a'


Share This Page