Conditions and repetition
Use ordinary TypeScript conditions and array mapping against validated email inputs and preview each branch with named fixtures.
The render function executes normal synchronous TypeScript. Use ternaries, if statements,
boolean conditions, imported functions and array mapping against actual validated input.
const content = (input: { name: string; items: string[] }) => (
<section>
<h1>Hello {input.name}</h1>
{input.items.length === 0 ? <p>No items yet.</p> : (
<ul>{input.items.map((item) => <li key={item}>{item}</li>)}</ul>
)}
</section>
);Use the @samva/markup/email JSX runtime. Add fixtures for both branches and for multiple rows.
The preview shows one executed fixture, so inactive branches have no rendered element to select.
Editing a repeated source block affects its instances; editing one row's fixture data is a separate
operation. Define the input schema and fixtures on the template entry.