← All Playbooks • AI & Formatting • 5 min read

Convert Markdown (ChatGPT / Claude / Copilot Output) to Clean HTML Email in Power Automate

Turn raw LLM Markdown (**bold**, tables, code blocks, bullet lists) from Azure OpenAI, ChatGPT, or Claude into sanitized, Outlook-ready HTML for emails, Teams cards, and PDFs in Power Automate.

⚠️ Common Power Automate Bottleneck

When Azure OpenAI, Copilot Studio, or Claude returns responses into Power Automate, the text arrives as raw Markdown (### Headings, **bold**, | tables |). Sending that directly in Outlook V2 ("Send an email") produces broken plain text full of asterisks and hash symbols.

✅ Zetaleap Edge Architecture

Pass the raw AI Markdown output to Zetaleap’s AI Output & Markdown Formatter API (POST /api/tools/convert with mode: "md2html") to receive clean, XSS-sanitized HTML ready to paste straight into Outlook, SharePoint, or Word/PDF actions.

1

Capture Your LLM / AI Builder Output in Power Automate

After your "Create text with GPT", Azure OpenAI HTTP call, or Claude API step, store or reference the raw Markdown text string.

2

Call Zetaleap AI Output Formatter (md2html)

Use either the Zetaleap AI Formatter Custom Connector ("Convert Markdown or HTML") or an HTTP POST action to /api/tools/convert. Payloads up to 100KB execute at the edge in <25ms.

POST /api/tools/convert — Request Payload
POST https://zetaleap.com/api/tools/convert
Authorization: Bearer zl_your_personal_access_token
Content-Type: application/json

{
  "mode": "md2html",
  "text": "## Executive Summary\n\n- **Revenue:** +18% QoQ\n- **Action Required:** Approve Q3 budget."
}
3

Insert Dynamic Content result into Outlook "Send an email (V2)"

Switch the Outlook email body editor to Code View (</>) and insert body('Convert_Markdown')?['result']. Every heading, bullet list, table, and inline code block renders cleanly across Desktop & Web Outlook.

JSON Response Returned to Power Automate
{
  "success": true,
  "result": "<h2>Executive Summary</h2>\n<ul>\n<li><strong>Revenue:</strong> +18% QoQ</li>\n<li><strong>Action Required:</strong> Approve Q3 budget.</li>\n</ul>\n"
}