Incoming HTML Email Inconsistent


(James North) #1

Hi Folks,

I’ve been trying to use the incoming email method for posting pretty html emails into a sort of news thread on one of my Discourse forums.

I find that when the post is rendered, it strips out a bunch of images … but when I click on the little mail icon on the top right of the post and press ‘HTML’ it renders correctly.

Post Render

HTML Preview Render

Should they not look the same?


(Jeff Atwood) #2

The first thing to bear in mind is that HTML is converted to Markdown for posting. Not all HTML converts reasonably to Markdown.

On top of that, HTML standards are all over the map for email, so it’s indeterminate – depending on your mail client that may not render at all. It would be nice if you could assume

recent email client = current-ish version of modern web browser

but that is almost never the case. Even with Gmail there are significant limitations, that is why services like https://litmus.com/ exist and are critical.


(James North) #3

Thanks for the response Jeff.

So the fact that it’s in a post makes the markdown come into effect, whereas when Discourse itself previews the HTML in the overlay window in my post above, it’s not going through the markdown engine?


(Leo McArdle) #4

Yes, the contents of the post is a result of the email HTML being converted to Markdown, which is then converted back to HTML to display in your browser.

The HTML tab in the Incoming Email modal is just the email HTML being rendered in your browser directly.


(James North) #5

Thanks @LeoMcA!

Ah well :slight_smile: