How can I take html and prepopulate a rich text field with it?

I’m trying to prepopulate a rich text field with formatting as html. The source for my html is an email template.
What I’ve done so far is use a model to get the appropriate email template and the action framework to prepoulate the rich text field (which is an actual object field).
However the rich text field flashes the rendered html as expected and then displays the raw html.

Looking at the html source, I think that the html is being inserted as actual html so it displays as I expect, but then CK editor is escaping the html into text so it displays the raw html in the text editor.

How can I take html and prepopulate a rich text field with it?

Flashes this (which is what the html email looks like)

And then displays this

Have you tried to use a template component instead of the rich text editor, and clicking the “allow HTML” checkbox?

I have gotten it to display properly like that, but the field needs to be editable by the user.

Is anyone able to help with this please?

Shmuel, if you are wanting to apply html to a field that is editable by the user, then a JS custom renderer will most likely be the best course of action. The template and rich text components are really only for displaying information not being edited. 

Here is our tutorial on creating a custom renderer in a Table (it’s very similar in a Field Editor as well):

Thanks Matt. Your guidance is appreciated! 

Hi Matt,

The guide was helpful. Thank you! I wanted to let you know some of the examples don’t work anymore (seems to have something to do with the silk icon set).