Adding agent badge in Communities

38 Comentarios

  • Scott Bowen

    I have a question similar to @Marcel's a few months ago: We set up SSO for our help center, so anyone with a log-in to our service can participate in the community. I've set up badges for our agents, but I'd like to add a badge or image for any of our employees that participate in the forum.

    I've created an organization that includes anyone with our company's email address—Can I set the organization up as a target (like this example does with "agents") to create a specific badge?

    Would it be something like:

    {{#is post.author.organization 'Grow Employees'}}...

    I tried this, but "organization" wasn't something I could reference this way. Is there a way to do this?

    0
  • Jeremy Robinson

    Thank you @McCabe Tonna. That makes sense, and so far gets me where I am headed. I only see it working for moderators, but at least I have a starting point to investigate further now. I appreciate your work in looking into this and getting it in a more functional state for me.

    0
  • McCabe Tonna

    Got it working for both

    I tested someone's name "asdf"

    same css

    1
  • Brett - Community Manager

    Thanks for testing this McCabe and following up :)

    0
  • Marcel

    I have a question similar to @Marcel's a few months ago: We set up SSO for our help center, so anyone with a log-in to our service can participate in the community. I've set up badges for our agents, but I'd like to add a badge or image for any of our employees that participate in the forum.

    I've created an organization that includes anyone with our company's email address—Can I set the organization up as a target (like this example does with "agents") to create a specific badge?

    Would it be something like:

    {{#is post.author.organization 'Grow Employees'}}...

    I tried this, but "organization" wasn't something I could reference this way. Is there a way to do this?

    Tricky one indeed. We also use SSO in our organization and what I ended up doing was this:

    script.js

     // Adds custom badges for individual community forum users
    var supportEngineer = ["Support Engineer Name 1", "Support Engineer Name 2"];
    var developer = ["Developer Name 1", "Developer Name 2"];
    $('.add-badge').each(function(index) {
    if ($.inArray($.trim($(this).text()), supportEngineer) > -1) {
    $(this).addClass('supportEngineer');
    }
    else if ($.inArray($.trim($(this).text()), developer) > -1) {
    $(this).addClass('developer');
    }
    });
    if ($.inArray($.trim($('.post-author').text()), supportEngineer) > -1 ) {
    $('.post-author').addClass('supportEngineer');
    }
    else if ($.inArray($.trim($('.post-author').text()), developer) > -1 ) {
    $('.post-author').addClass('developer');
    }
    });

    style.css

    /* Add custom badges to individual users */
    .add-badge {
    /* Empty class for badges; for reference only */
    }

    .moderator:after {
    content: "Moderator";
    background-color: #EB553C;
    border-radius: 3px;
    color: white;
    margin-left: 8px;
    padding: 2px 5px;
    font-size: 10px;
    }

    .supportEngineer:after {
    content: "Support Engineer";
    background-color: #EB553C;
    border-radius: 3px;
    color: white;
    margin-left: 8px;
    padding: 2px 5px;
    font-size: 10px;
    }

    .developer:after {
    content: "Developer";
    background-color: #EB553C;
    border-radius: 3px;
    color: white;
    margin-left: 8px;
    padding: 2px 5px;
    font-size: 10px;
    }

    Works well so far and I use 2 additional roles in our live environment. The only downside so far is, that you have to manually add every employee, who does not have an agent role in Zendesk, although they are part of our organization (while moderators are getting flagged with the badge automatically due to their role).

    But it looks like you simply cannot reference an organization in the script.js, at least I did not find a reference in Zendesk's Objects for Help Center templates.

    Would absolutely love, if someone here found a way to reference organizations here, so we can automatically assign them badges.

    Best,
    Marcel

    0
  • Scott Bowen

    Thanks Marcel! I was also hoping to skip that process of adding each person in JS, but I can do this for now. I appreciate you sharing your example!

    0
  • Dan Ross

    Hey Marcel,

    Unfortunately, the user object in the Guide only doesn't return the default org of the user in the response That could be a good feature request though that would solve this use case, and i'm sure many others!

    Not sure if there's a safe way to do this with JS, since you'd need to make an API call to Zendesk if you wanted to get organization data.

    Since JS is client-side and there's limited control over the environment of Guide, your credentials would be visible to anyone who knows how to look at the source JS files in browser. This is a Bad Thing™and I wouldn't advise it. 

     

    0
  • Marcel

    Hi Dan,

    Not sure if there's a safe way to do this with JS, since you'd need to make an API call to Zendesk if you wanted to get organization data.

    Since JS is client-side and there's limited control over the environment of Guide, your credentials would be visible to anyone who knows how to look at the source JS files in browser. This is a Bad Thing™and I wouldn't advise it. 

    Thank you for the detailed background info, fair enough.

    Best,
    Marcel

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk