Code RoomEmail template renderer
MediumPrep Room Coding #4358

Email template renderer

Vibe & agenticML systemsMid–Senior~18 min

You need an email template renderer in Python that takes a template plus user-supplied data (name, order details) and produces the final HTML email body. You'll ask an AI agent to build it. Write the prompt/spec — constraints, edge cases, acceptance criteria — for a first-try-correct result. What does a careless prompt ("render this email template with the user's data") get wrong, security-wise and otherwise?

Implement
render_email_html(template_text: str, data_lines: list[str], max_length: int) → str
Examples
in["<p>Hi {{ name }}, order {{ order_id }} is on its way.</p>",["name=O'Brien & Sons","order_id=A-1042"],0]out"<p>Hi O&#39;Brien &amp; Sons, order A-1042 is on its way.</p>"
in["<p>Hi {{name}}!</p>",["name=<img src=x onerror=alert(1)>"],0]out"<p>Hi &lt;img src=x onerror=alert(1)&gt;!</p>"
in["<p>Order {{ order_id }} for {{ name }}.</p>",["name=Ada","no-equals-sign-here"],0]out"<p>Order for Ada.</p>"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.