Question

Hoe can i send html response in conversation reply

  • 10 September 2022
  • 4 replies
  • 225 views

Hi,

According to

https://developers.intercom.com/intercom-api-reference/reference/reply-to-a-conversation

it says "Notes accept some HTML formatting."

 

I am using below html as

<html> <body> <h4>Share screen recordings</h4><br>

            <img src="{video_icon}" alt="no image">

            <a href='{record_link}' style="margin-top:30px; text-align:center; display:block;" >Record your screen</a>   </body> </html>

 

However the style part is missing in the output. Can some one guide me what limitation exists on HTML formatting.

 

I wanted to post an app in the reply, but i do not see any rest api where i can embed App in the conversation reply. That's the reson i am posting html form of my app rather than canvas. Kindly let me know if this is possible

 


4 replies

Badge +1

This took a while haha, but I think I figured it out for you.

 

Firstly the code you've placed is missing a '<' somewhere, but I've fixed it up a bit.

 

I changed it up so that there is a Div and the style is set for that. I did this in Postman and one issue I ran into is that it didn't like me using " I had to use ' instead.

 

<html><body><div style='margin-top:30px; text-align:center; display:block;'><a href='https://google.com#39;>Record your Screen</a></div></body></html>

I sent this in the body and this is the result I got:

 

image 

I am curious as well on what the limits of HTML can be sent through, but hopefully this is the formatting you were looking for 🙂

 

@Azure Radio 277​ might be worth making some clarifying documentation around HTML usage and it's limitations.

 

For further context I tested this using Postman, and here's my full code in the body:

 

{
"message_type":"note",
"type":"admin",
"admin_id":"XXXXXXX(ommittedactualadminIDforobviousreasonslol)",
"body":"<html><body><div style='margin-top:30px; text-align:center; display:block;'><a href='https://google.com#39;>Record your Screen</a></div></body></html>"
}

Hope that helps!

 

 

Badge +1

Oh sorry I forgot to include all the code besides just the style of the link:

<html><body> <h4>Share screen recordings</h4><br><img src='https://oetonline.net.au/pluginfile.php/43232/mod_resource/content/1/YoutubeIcon.png#39; alt='no image'><div style='margin-top:30px; text-align:center; display:block;'><a href='https://google.com#39;>Record your Screen</a></div></body></html>

 

 

Using just a random video image with this code it looks like this.

 

image 

Hopefully that replicates exactly what you're aiming for, though probably with a smaller image size haha.

Hi Zak,

Thanks for reply. this does not work for me. even if you mention width and height for image, it's not working. You can inspect and see if styles are applied or not. Try color attribute for link. So i think @Azure Radio 277​  should guide to appropriate documentaion or approach on this.

Badge +1

Hey Shivprasad,

 

Could you clarify in what way it's not working? Are you able to replicate it at least the way I was able to based on the screenshot provided?

I tested this by sending an API call, so if you're not seeing it work like in my screenshot we may need to have a look at your code, but if you're trying to do something else I can take another look.

Reply