Allow only signed-in users to submit a ticket

10 Comments

  • Annastashia Cambridge

    Hi Diziana, this is really useful thank you! It works that when the anon user selects the submit a request link it brings up the sign in/sign up screen. How can I apply the same logic to the mobile layout? 

    How can I apply the same logic to the mobile layout? The submit a request brings up the submit a request form which I don't want. 

    Many thanks, 

    Annastashia

    0
  • Diziana

    Hi Annastashia,

    Thanks for reaching out to us. I think this should work. Did you disable the mobile layout from the HC settings? 

    I looked at your HC and it seems you haven't disabled the mobile layout option, please disable it.

    Also on responsive you need to add the submit button on the menu (hamburger icon) as for now only sign in seems to be listing.

    Please share if you have further any questions.

    Looking forward hearing from you.

    Cheers,

    Diziana

    0
  • Jake Bantz
    Zendesk Product Manager

    Thanks for the tip Diziana.

    I did want to advertise that we now have some built in functionality to allow you to check if a user has signed in. Here's the sample code:

    {{#if signed_in}}
    {{link 'new_request'}}
    {{/if}}

    You can read more about the 'signed_in' helper here. This removes the need for Javascript, and instead the user will get the page without the submit a request link right away if they are not authenticated.

    Hope this is helpful!

    0
  • Jennifer Rowe
    Zendesk Documentation Team

    Oh, that's good to know. Thanks, Jake.

    0
  • Bob Swail

    Zendesk - that's a good workaround for hiding the links from end-users, but that does not prevent them from using:

    https://{{base_url}}/hc/en-us/requests/new

    to get around it. 

    Is there a config setting or strategy that would not allow users to log a request unless logged in?

    Cheers,

    Bob

    Update - I used in the new_request_page.hbs so that seems to prevent anyone from invoking the https://{{base_url}}/hc/en-us/requests/new on the URL.

    {{#if signed_in}}
    ...
    {{/if}}
    0
  • Jake Bantz
    Zendesk Product Manager

    You hit the nail on the head Robert! Wrapping the signed in condition around the ticket form will hide it for anonymous users as well. You could even include a message as an alternative (using an 'else' condition) like this:

    {{#if signed_in}}
    <h1>
    {{t 'submit_a_request'}}
    {{#if follow_up}}
    <span class="follow-up-hint">
    {{follow_up}}
    </span>
    {{/if}}
    </h1>
    <div class="form">
    {{request_form}}
    </div>
    {{else}}
    <h3>Please sign in to submit a ticket.</h3>
    {{/if}}

    This is from the default Copenhagen theme, so yours might look a little different, but I hope this helps.

    0
  • Fong Teck Leong

    Hi Jake, what if i want to hide the submit request even for sign-in user, but embed the ticket form link at the article (which will prompt for user to sign in with above use of signed_in condition)

    0
  • Jake Bantz
    Zendesk Product Manager

    Hello!

    First, I would recommend removing the request placeholder from the Header template since you don't want it to appear for any users.

    Next, know that our default Copenhagen theme has a request callout in its article_page.hbs template that looks like this:

    Here's the associated code:

    <div class="article-more-questions">
    {{request_callout}}
    </div>

    You could recycle my tip above, but instead wrap that around the request_callout:

    {{#if signed_in}}
    {{request_callout}}
    {{else}}
    Please sign in to submit a request.
    {{/if}}

    Hope that helps!

    0
  • Yuliia Support Team Lead

    Hi Jake. Thx for the article! it is super helpful. We would like to show the "submit a request" form for registered users only, however for the unregistered ones, we would like to show an alternative short submission form. how would we do that?

    1
  • Alejandro Colon

    @...

    My organization does not use multiple forms but to achieve what you are looking for, I would use the "else" portion of this tip and follow the instructions from @... post here https://support.zendesk.com/hc/en-us/articles/206977397-Multibrand-Display-the-appropriate-forms-on-the-correct-Help-Center 

    There is a section called "Displaying one form per brand"

    @... also, provides a way to redirect users and edit other links in the comments of that post. https://support.zendesk.com/hc/en-us/articles/206977397/comments/204904167

    0

Please sign in to leave a comment.

Powered by Zendesk