Feature Request - email:body:bodyparts:html_to_markdown

Hello

Not much more to say that the title.
We are pulling plaintext ticket descriptions and notes from Autotask with n8n via the API, and in many cases passing them to an LLM.
Having them in markdown format would significantly increase the value proposition.

Excellent idea. It will happen.

We should have this live in the next few days:

@Mark Ok, this is live now. :slight_smile:

Documentation here: Convert Text | MSPintegrations

This new action step gives you the ability to convert any text between plaintext, HTML, and Markdown (not just the email body). I couldn’t think of any more formats besides those 3, but we’d be happy to consider adding more formats if you have any more that would be helpful.

You are a superhero Travis, thank you.

I have tested this and it’s working great as a replacement for {{email.bodyparts.html_to_plaintext}}.
However, I would much prefer to use {{email.body_stripped.visible}} in some cases, and that is only available to me in plaintext?

If anyone else comes across this problem I have solved it by implementing my own analogue for body_stripped.visible.

Basically, the issue was that an email would arrive with a long chain of replies, and all of this was being added as note updates to tickets.
I have used a regex to identify the From: or ‘wrote’ lines indicating the start of the last email send from my company domain. And if it’s found, only use the text before this match.
This way, multiple emails sent after our last addition to the chain will appear, but from our last addition back will be stripped.
This does not help with the email signatures, but it is a huge improvement over adding the entire chain to every note.

Hi @travis, there seems to be some issues with the way the markdown is being rendered.
If you please take a look at MSPintegrations

The html_tp_plaintext is beautiful, but the markdown conversion from bodyparts.html is a mix of both markdown and html…

As a random test, the html from the Email2AT log throw into ▷ HTML to Markdown Converter produces much cleaner results…

Can you have a look at the conversion please?

Thanks for reporting this, @Mark . We just released a release to the beta console that uses a different markdown conversion process. It seems to do a much better job.

This is live on the beta console right now (NOT on the production flow). You can test it only by manually “Reprocessing” a message in your history when viewing it on the beta console. For example, you can re-process the example you gave earlier here:

1779368487340004ag91

Let me know if that looks better. The change should be live in the production system in the next day or two.

Hi @Mark

This fix/update is now live.

Please let me know if this looks better.

Thanks!!

Hi Travis,

Please see MSPintegrations
The bottom half of the body text (content after “May 21, 09:00 EDT ### Components affected”), seems to be missing in the markdown.