Glip webhooks: Render basic HTML or strip HTML elements

  • 1
  • Problem
  • Updated 11 months ago
Hi,

We're bout to switch to Glip, and one of our use cases is for incoming messages posted via Webhook. Unfortunately, our service desk provider doesn't strip HTML from the description, so when we include the body a lot of HTML gets posted along with it, making it unreadable.

The service desk in question is Freshdesk.

Can there be a flag introduced to "strip_html or "render_basic_html" ? Elements include, with some styling:
  • <br>
  • <div>
  • <a>
  • <span>
  • <table>
  • <td>
  • <tr>
Photo of Joseph Porter

Joseph Porter

  • 120 Points 100 badge 2x thumb
  • frustrated

Posted 12 months ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,502 Points 5k badge 2x thumb
HTML text rendering is not supported. Because all html tags are escaped before rendering.

You can convert the HTML to glipdown format before posting it to Glip.
Photo of John Wang

John Wang, Official Rep

  • 5,664 Points 5k badge 2x thumb
Who is the service desk provider?

To modify the webhook message, you can create a simple proxy to receive the message, modify it, and forward it to Glip. You would use your proxy's URL with the provider. I have some example code here:

https://github.com/grokify/webhookproxy

If the service desk provider has a free account program, I could look into whipping up a converter for the webhookproxy app.
(Edited)
Photo of Joseph Porter

Joseph Porter

  • 120 Points 100 badge 2x thumb
Freshdesk was able to help me with their syntax:
{{ ticket.description_text }}
and
{{ ticket.last_public_comment | strip_html }}
Photo of John Wang

John Wang, Official Rep

  • 5,632 Points 5k badge 2x thumb
Thanks for posting the solution Joseph!
Photo of Joseph Porter

Joseph Porter

  • 120 Points 100 badge 2x thumb
Yeah, it's still not very elegant or pretty: Glip could do a lot just by removing duplicate whitespaces and repeated line breaks, unless placed in a <code> container.
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,002 Points 5k badge 2x thumb
Glip supports [code] instead of <code>. Example: [code]your text here...[/code]