question

joseph-porter510 avatar image
joseph-porter510 asked ·

Glip webhooks: Render basic HTML or strip HTML elements

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>

aaa
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered ·
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.
Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

John Wang avatar image
John Wang answered ·
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.
Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

joseph-porter510 avatar image
joseph-porter510 answered ·
Freshdesk was able to help me with their syntax:
{ { ticket.description_text }}
and
{ { ticket.last_public_comment | strip_html }}

3 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks for posting the solution Joseph!
0 Likes 0 · ·
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.
0 Likes 0 · ·
Glip supports [code] instead of <code>. Example: [code]your text here...[/code]
0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.