Show message to users in organization only (or registred)



  • Diziana


    I think, you can do this. I am sharing an example where you can show a message to signed-in users, override that message for users who belong to at least one organization, and further override that for user who belongs to any special organization (from predefined list).

    {{#if signed_in}}
    <div id="org_message"></div>
    //List of organizations you want to check for
    var allowedOrganizations = ["Organization 1", "ORG2"];

    function userBelongsToAllowedOrgnizations(allowedOrganizations, userOrganziations) {
    var userOrgs = userOrganziations || [];
    var found = userOrgs.find(function (userOrg) {
    return allowedOrganizations.some(function (ao) {
    return ao ===

    return found || false;

    function userBelongsToAtleastOneOrganization(userOrganziations) {
    return userOrganziations.length >= 1;

    $(document).ready(function () {
    var message = "Default message shown to all signed-in users.";
    //Use an internal API; if it's gone tomorrow, this can be pulled via API
    var userOrganziations = HelpCenter.user.organizations;
    //check and show message to user belonging to at least one organization;
    if (userBelongsToAtleastOneOrganization(userOrganziations)) {
    message = "Yay! You belong to at least one organization.";

    //check and show message to user belonging to one of organization from allowedOrganizations;
    if (userBelongsToAllowedOrgnizations(allowedOrganizations, userOrganziations)) {
    //Update the message (above) to something else for user belongs to listed organizations.
    message = "Yay! You belong to one of organziations we love most.";

    $("#org_message").html("<p>" + message + "</p>");
    {{!-- Not signed-in; won't show message --}}


    Thank you

    Team Diziana


Please sign in to leave a comment.

Powered by Zendesk