1. The forum you are viewing relates to Kayako 3, which reached end of life in 2012. Please be aware that a lot of information relating to features, sales and the roadmap in the Kayako 3 forums is now outdated or defunct (i.e. plain wrong!).

    If unsure about anything, please create a new thread or contact us.

    You can visit the main forums for the latest Kayako here.

Custom fields info to email_alert.

Discussion in 'Customizing, extending and styling Kayako 3' started by jyri.nurk, Oct 26, 2009.

  1. jyri.nurk

    jyri.nurk New Member

    :confused: Hello -
    in advance=sorry for bad english!

    First: Is there a chance to put some info from custom fields, (from Support Center ticket submission area), to that notification e-mail that comes to staff members?

    Second: Another problem is, how can I add one "dropdown-select" menu into the field where user fills the Username-Email-Priority field?

    These problems appeared when, from my company witch is in 5 buildings, staff users complained that they wanna see already from Inbox to what building it is referred to. Cause when they see only that someone from they'r department has a ticket, they have to login to staff cp, somehow I can understand them. :eek:
    Also I have been looking around the forum and could'nt find any answers for my problem.

    Can please someone help on directing me the right way to solve this little problem!
  2. supportskins

    supportskins Kayako Guru

    I do not believe this is currently possible. You might have to look into source code modification.
    Admin CP > Custom Fields (Add a custom field group for client ticket submission)
  3. jyri.nurk

    jyri.nurk New Member

    thanks for the answer. sorry i wasnt exact, i wanna insert a field into Username-Email-Priority group.

    Ok, you say that from source - but can you atleast direct me where i can start or what should i be looking for. :)
  4. supportskins

    supportskins Kayako Guru

    You can add a "custom" custom field and manually add its code in the submitticket template. That should do the trick.
  5. jyri.nurk

    jyri.nurk New Member

    Ok. that sound locically, but there is one problem- im not so advanced to get that done ina hop. So where i can find this "custom" field's custom code, so that i can put that code into the template.
    Maybe little durections. :eek:
  6. jyri.nurk

    jyri.nurk New Member

    Do i have to put it in here?

    <{if $_USER[loggedin] == false}>
            <td width="30%" align="left" valign="top" class="row2"><span class="<{if $posterror == true && $fullname == ""}>redtext<{else}>smalltext<{/if}>"><{$language[tfullname]}></span><span class="redtext"> *</span></td>
    <{if $ismodernbill == true}>
            <td width="70%"><input name="fullname_show" type="text" size="25" class="swifttext" value="<?php global $this_user; print( $this_user['client_fname'] . " " $this_user['client_lname'] ); ?>" disabled><input name="fullname" type="hidden" value="<?php global $this_user; print( $this_user['client_fname'] . " " $this_user['client_lname'] ); ?>"></td>
    <{elseif $iswhmcs == true}>
            <td width="70%"><input name="fullname_show" type="text" size="25" class="swifttext" value="<{$whmcsuser[firstname]}> <{$whmcsuser[lastname]}>" disabled><input name="fullname" type="hidden" value="<{$whmcsuser[firstname]}> <{$whmcsuser[lastname]}>"></td>
            <td width="70%"><input name="fullname" type="text" size="25" class="swifttext" value="<{$fullname}>"></td>
            <td align="left" valign="top" class="row2"><span class="<{if $posterror == true && $email == ""}>redtext<{else}>smalltext<{/if}>"><{$language[temail]}></span></span><span class="redtext"> *</span></td>
    <{if $ismodernbill == true}>
            <td><input name="email_show" type="text" size="25" class="swifttext" value="<?php global $this_user; print( $this_user['client_email'] ); ?>" disabled><input name="email" type="hidden" value="<?php global $this_user; print( $this_user['client_email'] ); ?>"></td>
    <{elseif $iswhmcs == true}>
            <td><input name="email_show" type="text" size="25" class="swifttext" value="<{$whmcsuser[email]}>" disabled><input name="email" type="hidden" value="<{$whmcsuser[email]}>"></td>
            <td><input name="email" type="text" size="25" class="swifttext" value="<{$email}>"></td>
            <td align="left" valign="top" class="row2" width="30%"><span class="<{if $posterror == true && $priorityid == ""}>redtext<{else}>smalltext<{/if}>"><{$language[tpriority]}></span></td>
            <td><select name="priorityid" class="swiftselect">
            <{foreach key=key value=item from=$ticketpriorities}>
            <option value="<{$item[priorityid]}>" style="COLOR:<{$item[frcolorcode]}>;BACKGROUND:<{$item[bgcolorcode]}>;"<{if $tgroup[priorityid] == $item[priorityid]}> selected<{/if}>><{$item[title]}></option>
          <{if $_USER[loggedin] == true}>
  7. supportskins

    supportskins Kayako Guru

    That is correct.
  8. jyri.nurk

    jyri.nurk New Member

    Ok, now i feel kinda stupid. :confused:

    But my question was - where I can find the "custom" fields code - and Where in the submitticket template I have to put it - I have tried many possibilities but - when i do a mod in the template, the support center wont display anything.
    And I'm not a programmer, in php - im a rookie - but hungry for knowledge :D
  9. jyri.nurk

    jyri.nurk New Member

  10. Jamie Edwards

    Jamie Edwards Chief Limey Staff Member

    The forums are for community support. You are not guaranteed that a Kayako representative will reply to your questions here - for technical support or to get in touch with us, please open a support ticket.

    This policy is described on our website, in the forum rules and (as part of) the link to the forums from our website.

    Community forums - Kayako help desk software

    Technical support - Kayako help desk software, live chat software

  11. jyri.nurk

    jyri.nurk New Member

    Been there done that - maybe i'll do it again, but for now i think that with "supportskins" im getting somewhere.

    Also thanks for the suggestions.:D
  12. Dinker Sangar

    Dinker Sangar Kayako Staff

    Solution :

    In order to get a Custom Field information (added by a client during ticket submission) in the Staff E-mail alerts, there is a minor change required in the templates related to Alerts. For example, we consider the template 'alert_newticket' (Admin CP > Templates > Manage Templates) for New Ticket alerts.

    Following is the code required to insert the custom field information in the alert e-mails :

    <{$field[title]}> : <{$field[value]}>

    For help, please refer to the attached screenshot.
    - Screenshot 1 shows the template modification
    - Screenshot 2 shows the ticket submitted with a custom field
    - Screenshot 3 shows the resulted output in staff alert e-mail

    Hope, this helps! And please consider this as an example, any further changes can be made accordingly in the templates as per the requirements.

    Attached Files:

  13. Dinker Sangar

    Dinker Sangar Kayako Staff

    Just missed one part, here it is.
    The suggested change in the template will only show one Custom Field in the Alert e-mails. So please use the following code in the related templates(such as 'alert_newticket') in order to get more than one Custom Field in the Staff Alert e-mails :

    <{foreach key=fieldkey value=field from=$cfgroup[fields]}>
    <{$field[title]}> : <{$field[value]}>

    Please refer to the attached snapshots for reference. Thank you.

    Attached Files:

  14. Luke Pinion

    Luke Pinion Established Member

    Hm. I added the supplied code to the alert_newreply template, but when I tried to test it by replying to a test ticket it directed me to a new page and produced this error:

    PHP Warning: Invalid argument supplied for foreach() in C:\inetpub\wwwroot\support\modules\tickets\functions_alertrules.php on line 282

    I literally copied the code into the template as shown in the example images. Was there anything I was supposed to change?

    I am familiar with HTML and have an understanding of other programming languages, but I don't quite understand how those variables relate to the custom fields.
  15. james0254

    james0254 Member

    Hi, This is working for me apart from one of my custom fields has check boxes. The alert email shows all the custom fields but just says ARRAY where the check box custom field is. Any idea on how to fix this?


  16. Dinker Sangar

    Dinker Sangar Kayako Staff

    You are facing this issue due to the type of the field. The code mentioned in previous posts is for field type 'text' and was provided for reference. The field type in your case is 'checkbox', so you will have to add additional code in the template for this. For example :

    <{foreach key=optionkey value=option from=$field[value]}>
    <{$field[title]}> : <{$option[value]}>

    Also, please consider this as an example, as separate code is required for all custom field types. You can find the required variables for each field type in 'customfieldconfirmstatic' template and use them as required. For your reference, the 'customfieldconfirmstatic' template is used for submit ticket confirmation page and displays all the custom fields there. Hope, that helps.

    Merry Christmas, and Happy New Year in advance.
  17. james0254

    james0254 Member

    Thankyou. This was useful but im not too good with coding yet and im still not getting it to work.
  18. jason.jackson

    jason.jackson New Member


    I am still not able to get this to work. I have several text boxes and checkboxes that are customized fields. When I place this code into the alert_newticket, my e-mail show nothing. What am I missing? Do I need to modify this code to show my fields?

    Jason Jackson
  19. Dinker Sangar

    Dinker Sangar Kayako Staff

    Yes, you will have to modify the code as per the type of Custom Fields you have inserted. As suggested in my previous replies to this post, the code was provided for reference and is for custom field type 'text'. So you may have to customize it further as per your requirements. For example, read post #16 in this thread where the sample code is provided for custom field type 'checkbox'.
  20. chrisbrown

    chrisbrown New Member

    I am having problems getting this working with a drop-down box...Could someone please advise how to go about this?

Share This Page