Validating email address in custom field of a ticket

Respondida

4 Comentarios

  • PROVENTIC **** EMEA Reseller Partner
    Community Moderator

    Hi PA-eps

    You can definitely use Regex to validate the email you get from a user. Try looking at: https://emailregex.com/ 

    You can't use it to validate that the domain is the same as the logged-in user, unfortunately.

    Not natively anyway...

    There is an undocumented/unsupported object called "Helpcenter" where you can pull information on the logged in user. Using javascript you can find the domain and match it to whatever the is in the custom field.

    0
  • Andrew Soderberg
    Community Moderator

    PROVENTIC **** EMEA Reseller Partner The following Support post thread will have the start of what you need to place a script into Guide to use the 'Helpcenter' object and parse the email address field in the form to validate it. 

    While the topic's title is about hiding ticket forms based upon a user's organization, in the comments are a number of other examples.

    https://support.zendesk.com/hc/en-us/articles/204579603-How-can-I-hide-ticket-forms-based-on-a-user-s-organization-

     

     

    0
  • PA-eps

    Thank you Andrew Soderberg for the pointer. I'm not sure which comment from that article you're referring to. Would you be able to post a direct link to the comment from that discussion?

     

    0
  • Andrew Soderberg
    Community Moderator

    PA-eps, It wasn't a specific comment (there is not a specific example that matches your email validation request), it was really about many of them as there are different example uses of the 'HelpCenter' object via javascript to perform some action based upon the value found.

    So some work would be needed to edit the examples in that post to get the value of the email subcomponent of the 'help center' object:

    HelpCenter:user:email (the value stored here is the email of the submitter from Zendesk's record of this user)

    The Javascript would have to parse the email for the domain. do the same for the email entered into the form field for the added email address and then compare the two.

    You can see the contents of the HelpCenter object using Chrome's Developer Tools (use the Watch feature and add HelpCenter as the objects to watch). 

    With this info you would need to find a script as Carsten has mentioned to parse and validate the email address entered in the field and compare it to the submitter.

    As I am not a javascript developer I can't help much further. But as a web developer, I know this is possible and these are the broad brush steps to take.

    You may want to cross post your question above to that thread as well. 

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk