Spec an order email renderer for untrusted text

Vibe codingMedium25 min

Your task

Your Python shop sends order emails: confirmations, shipping notices and receipts. Each email fills a template with text that customers and sellers typed, such as the customer's name, product titles and a gift message. An agent will build the renderer that turns a template and that data into the final email.

Write the spec you would hand the agent.

What you know:

  • Python 3.12 and Jinja2; templates live in templates/email/
  • the sending API takes a subject, an HTML body and a text body
  • sellers can add a link to their store page, and it appears in the email
  • an email once went to thousands of customers starting with "Hi ," because the name was missing

Then, in a few sentences: what does "render this email template with the user's data" get wrong?