Start a conversation

Preventing Users Not Logged in From Starting Conversations via the Help Center

Overview

You can prevent users who are not logged in (guest users) from starting a conversation by tweaking the templates that control the appearance of your Help Center.

This article shares information for changing a line of code in your Help Center template to hide the 'Start a conversation' link for any users that are not logged in.

 

Diagnosis

Logged in users are users who went through the process of signing in to the Help Center using their Kayako credentials (email address) and password,  Twitter, Facebook, or Google accounts. This means that the user is registered on your Kayako help desk and has somehow gone through the process of validation.

The reason why you would want to prevent guest users or those who are not logged in to your Help Center from starting a conversation is to prevent spammers who may attempt to use your Help Center to send spam messages from there. 

 

Prerequisite

  • To edit the Help Center templates, you will need an admin account with the "Manage the Help Center" permission.

 

Solution

To edit the Help Center templates, please follow these steps:

    1. Log in to Kayako as admin and go to your Help Center.
    2. Click the Customize button on the upper right.

    3. Click Customize templates on the menu on the left.

      help_center_customize.jpg

    4. Navigate to the Template: Header

      mceclip0.png
    5. In the 'Header' template, find the following line of code:

      <a class="menu__submit sm-max-hide" href="{{ URL }}/conversation/new">{{ phrase('header.menu.startconversation') }}</a>
    6. Replace the line from step 5 with:
      {%if current_user is defined %}
      <a class="menu__submit sm-max-hide" href="{{ URL }}/conversation/new">{{ phrase('header.menu.startconversation') }}</a>
      {%endif%}
    7. To hide the Start a conversation button on smaller screens, such as mobile devices, add the following code to the template:
      {%if current_user is not defined %}
      <script>
      document.addEventListener("DOMContentLoaded", function(){
      var convstarter = document.querySelector('.sm-lg-plus-hide.lg-plus-hide.wrap--body.u-mtop.u-mbottom a[href$="/new"]')
      convstarter.remove()
      })
      </script>
      {%endif%}
    8. Click Save.

NOTES:

  • If you need to restore the original template, click the Revert to default button.
  • For more details on template customization, please refer to our user guide article on editing Help Center templates.

 

Confirmation

After making the changes, you will notice the 'Start a conversation' link next to the 'Sign in' link will no longer appear.start_a_convo_hidden.jpg

Once the user signs in, the 'Start a conversation' link will be available.

mceclip1.png

 

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

  2. Posted

Comments