# Add HTML Code using postMassges

**URL:** https://forum.collaboraonline.com/t/add-html-code-using-postmassges/3481
**Category:** Development
**Created:** [March 6, 2025, 4:58pm UTC](https://forum.collaboraonline.com/t/add-html-code-using-postmassges/3481 "2025-03-06T16:58:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DiegoLuzBraga](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/diegoluzbraga/32/1585_2.png) [@DiegoLuzBraga](https://forum.collaboraonline.com/u/DiegoLuzBraga)
#### Post date: [March 6, 2025, 4:58pm UTC](https://forum.collaboraonline.com/t/add-html-code-using-postmassges/3481/1 "2025-03-06T16:58:08Z")

</div>

Hello!

I’m pretty new to using the editor, so I have a few questions.  
Can postMessages be used to insert an HTML from my backend to the editor render?

Like this:  
`<div style='text-align: center; font-family: arial,helvetica,sans-serif; font-size: small;'><img style='-webkit-user-select: none' src='loadimage.jpg'><br />This should be my text<br />#{variable}<br />#{variable}<br />Contato: (#{procevariable}) #{variable} - Email: #{variable}</div>`

Right now I’m using the InsertText function to add it, but it adds this as text.  
Also, is it possible to add a select element to the header? I’m using the “Insert\_Button” postMessage to add a button that opens a modal for the user to get the info I need.

---

<div class="post-metadata">

### Author: ![vmiklos](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/vmiklos/32/787_2.png) [@vmiklos](https://forum.collaboraonline.com/u/vmiklos)
#### Post date: [March 7, 2025, 8:39am UTC](https://forum.collaboraonline.com/t/add-html-code-using-postmassges/3481/2 "2025-03-07T08:39:02Z")

</div>

To insert HTML, did you consider `Action_Paste` ? See [PostMessage API — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/postmessage_api.html)

`text/html` should work as a mimetype.

---

<div class="post-metadata">

### Author: ![DiegoLuzBraga](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/diegoluzbraga/32/1585_2.png) [@DiegoLuzBraga](https://forum.collaboraonline.com/u/DiegoLuzBraga)
#### Post date: [March 7, 2025, 11:16am UTC](https://forum.collaboraonline.com/t/add-html-code-using-postmassges/3481/3 "2025-03-07T11:16:14Z")

</div>

@vmiklos thanks for the replay! It worked, but when trying to put the image in the HTML, the editor showed me an error message, saying it could not add an image from another site.

---

<div class="post-metadata">

### Author: ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)
#### Post date: [April 16, 2025, 10:12am UTC](https://forum.collaboraonline.com/t/add-html-code-using-postmassges/3481/4 "2025-04-16T10:12:38Z")

</div>


