Implementation of an optimization to prevent light agents from mistakenly using CC functionality when logging in tickets via HelpCenter

1 댓글

  • Ben Bauer

    Hi Josef,

    I just ran into this issue today. This is by no means an ideal "solution", but I made a tweak to our help center website that hides the CC field from both Agents and Light Agents. End-users can still use the CC field. At this point, I'm not aware of a way to distinguish between Agents and Light Agents in the jquery.

    1. Go to 'Guide admin'

    2. Go to 'Customize design' and click 'Customize' on your Live theme

    3. Click 'Edit code' in the bottom-right

    4. Scroll down and select the 'script.js' file

    5. Paste this code anywhere below the "document.addEventListener('DOMContentLoaded', function() {" line:

    //BB|Start|show and hide elements for various users
    (function() {

    // check if user is signed in
    if (HelpCenter.user.tags) {
      var isAgent;

        // find the element
      function agentCheck(element) {
    return (element === 'agent')
      }

      //go through the HelpCenter object and look for user role
      isAgent = agentCheck(HelpCenter.user.role);

      // hide stuff from Agents & Light Agents
      if (isAgent === true) {
      $('.request_cc_emails').each(
      function(index) { 
    $(this).css("display", "none");
      }
    );
      }
    }
    }());
    //BB|End|show and hide elements for various users

    6. The jquery might not work until this is added into the 'document_head.hbs' file:

    {{!BB|Start|add jQuery Core 3.6.0}}
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
    {{!BB|End|add jQuery Core 3.6.0}}
    0

댓글을 남기려면 로그인하세요.

Zendesk 제공