question

joseph-porter510 avatar image
joseph-porter510 asked Tyler Liu commented

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>

webhooks
1 |1500 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.
1 |1500 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.
1 |1500 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 Tyler Liu commented
Freshdesk was able to help me with their syntax:
{ { ticket.description_text }}
and
{ { ticket.last_public_comment | strip_html }}

3 comments
1 |1500 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 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys