Start a conversation

Maintaining Line Breaks and Spaces in Conversations Created Through the Help Center

Overview

When a user submits a ticket through the Help Center, the line breaks and spaces are usually removed once the ticket is converted into a conversation in Kayako. This is expected behavior as the Kayako default form is configured to do so. This behavior sometimes causes inconvenience as it may be hard for agents to read the ticket content.

This article provides information on configuring the template to maintain line breaks and spaces when submitting a ticket through the Help Center.

 


 

Process

To fix this issue, you need to add a custom Javascript code to the footer template. When the tickets are submitted, this code carries the line breaks and spaces in the new submissions or updates via the Help Center over the conversations. To add the Javascript code, please follow the process below.

  1. Sign in to Kayako.
  2. Go to the Help Center.
     
    mceclip3.png
     
  3. Click on the Customize button.
     
    mceclip0.png
     
  4. Under the Customize menu, select Customize templates.
     
    mceclip1.png
     
  5. From the Template drop-down, select the footer template
     
    mceclip4.png
     
  6. Once you have selected the footer template, add the code below at the end of the existing code.
     
    <script>
    document.getElementById("contact").addEventListener("submit", myFunction);

    function myFunction() {
    var x = document.getElementsByName("contents")[0].value;
    var y = x.split("\n"); // split string on new line
    var z = y.join("<br/>");
    document.getElementsByName("contents")[0].value = z;

    };
    </script>

    <script>
    document.getElementById("view-conversation-form").addEventListener("submit", myFunction);

    function myFunction() {
    var x = document.getElementsByName("contents")[0].value;
    var y = x.split("\n"); // split string on new line
    var z = y.join("<br/>");
    document.getElementsByName("contents")[0].value = z;

    };
    </script>
     
  7. Once you have finished making the changes, click on the Save button.
     
    mceclip1.png
     
  8. Refresh the Help Center page to make the changes take effect.

 

Back to top


 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments