Email message

Shows an email the way the recipient reads it: an inquiry a parent sent, the reply the club is about to send (in a flow's review) or sent earlier (in the history). direction marks which side wrote it: in is a neutral surface, out gets an accent edge and the label "Antwort".

The body is plain text; line breaks and blank lines are kept exactly (lists like "– Montag, 17:00" stay readable), long words and URLs wrap. It is never HTML: a message from outside the club cannot inject markup.

Use it to show, not to edit. The reply is edited in a field with control: "textarea"; the review then shows it again as a message so the person sees exactly what goes out.

Examples

Incoming inquiry

Anfrage

Probetraining für unseren Sohn

Von: Martina Keller <[email protected]> · heute, 08:23

Guten Tag Unser Sohn Luca (7) möchte gerne Taekwondo ausprobieren. Wann könnten wir zu einem Probetraining kommen? Freundliche Grüsse Martina Keller
Data
render({
  "label": "Anfrage",
  "from": "Martina Keller <[email protected]>",
  "dateLabel": "heute, 08:23",
  "subject": "Probetraining für unseren Sohn",
  "body": "Guten Tag\n\nUnser Sohn Luca (7) möchte gerne Taekwondo ausprobieren. Wann könnten wir zu einem Probetraining kommen?\n\nFreundliche Grüsse\nMartina Keller"
})
Markup
<article class="message" data-direction="in" aria-labelledby="message-by7yuu">
<p class="message__label"><svg class="icon" data-size="sm" aria-hidden="true"><use href="../../packages/ui/icons/icons.svg#user"/></svg>Anfrage</p>
<header class="message__head">
<p class="message__subject" id="message-by7yuu">Probetraining für unseren Sohn</p>
<p class="message__meta"><span class="u-visually-hidden">Von: </span><strong>Martina Keller &lt;[email protected]&gt;</strong> · heute, 08:23</p>
</header>
<div class="message__body">Guten Tag

Unser Sohn Luca (7) möchte gerne Taekwondo ausprobieren. Wann könnten wir zu einem Probetraining kommen?

Freundliche Grüsse
Martina Keller</div>
</article>

Outgoing reply (review before sending)

So geht die Antwort raus

Re: Probetraining für unseren Sohn

Von: Taekwondo Bern <[email protected]>

An: Martina Keller <[email protected]>

Liebe Familie Keller Vielen Dank für eure Nachricht! Wir schlagen euch dieses Probetraining vor: – Montag, 19. Oktober, 16:00–16:50, Dojang Muri Liebe Grüsse Sandra
Data
render({
  "direction": "out",
  "label": "So geht die Antwort raus",
  "from": "Taekwondo Bern <[email protected]>",
  "to": "Martina Keller <[email protected]>",
  "subject": "Re: Probetraining für unseren Sohn",
  "body": "Liebe Familie Keller\n\nVielen Dank für eure Nachricht! Wir schlagen euch dieses Probetraining vor:\n– Montag, 19. Oktober, 16:00–16:50, Dojang Muri\n\nLiebe Grüsse\nSandra"
})
Markup
<article class="message" data-direction="out" aria-labelledby="message-1rielpu">
<p class="message__label"><svg class="icon" data-size="sm" aria-hidden="true"><use href="../../packages/ui/icons/icons.svg#mail"/></svg>So geht die Antwort raus</p>
<header class="message__head">
<p class="message__subject" id="message-1rielpu">Re: Probetraining für unseren Sohn</p>
<p class="message__meta"><span class="u-visually-hidden">Von: </span><strong>Taekwondo Bern &lt;[email protected]&gt;</strong></p>
<p class="message__meta">An: Martina Keller &lt;[email protected]&gt;</p>
</header>
<div class="message__body">Liebe Familie Keller

Vielen Dank für eure Nachricht! Wir schlagen euch dieses Probetraining vor:
– Montag, 19. Oktober, 16:00–16:50, Dojang Muri

Liebe Grüsse
Sandra</div>
</article>

Data contract

What render(data) accepts — validated against this JSON Schema in development and tests. Unknown fields are rejected. The same schema is in components.json.

FieldTypeRequiredDefaultDescription
direction"in" | "out"optional"in"in: written to the club (inquiry). out: written by the club (reply, confirmation).
labelstringoptional—Small label above the header, e.g. "Anfrage", "Deine Antwort", "Gesendet von Sandra". Default: "Nachricht" (in) / "Antwort" (out).
fromstringoptional—Sender as shown, e.g. "Martina Keller <[email protected]>". Required unless bare.
min 1 chars
barebooleanoptionalfalseOnly the text (line breaks kept, clamp and toggle work), no frame, label or header — inside a card or section that already says who wrote it.
tostringoptional—Recipient as shown; usually only for outgoing mail.
dateLabelstringoptional—When it was sent or received, as display text ("heute, 08:23").
subjectstringoptional—Subject line.
bodystringrequired—Plain-text body; line breaks are kept.
min 1 chars
clampintegeroptional—Show at most about this many lines; longer messages get «Ganze Nachricht anzeigen» (no script: a <details> toggle). Use it where the message is context for a task, e.g. above a reply.
≥ 3
moreLabelstringoptional"Ganze Nachricht anzeigen"Label of the toggle for clamped messages.
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "body"
  ],
  "properties": {
    "direction": {
      "type": "string",
      "enum": [
        "in",
        "out"
      ],
      "default": "in",
      "description": "`in`: written to the club (inquiry). `out`: written by the club (reply, confirmation)."
    },
    "label": {
      "type": "string",
      "description": "Small label above the header, e.g. \"Anfrage\", \"Deine Antwort\", \"Gesendet von Sandra\". Default: \"Nachricht\" (in) / \"Antwort\" (out)."
    },
    "from": {
      "type": "string",
      "minLength": 1,
      "description": "Sender as shown, e.g. \"Martina Keller <[email protected]>\". Required unless `bare`."
    },
    "bare": {
      "type": "boolean",
      "default": false,
      "description": "Only the text (line breaks kept, clamp and toggle work), no frame, label or header — inside a card or section that already says who wrote it."
    },
    "to": {
      "type": "string",
      "description": "Recipient as shown; usually only for outgoing mail."
    },
    "dateLabel": {
      "type": "string",
      "description": "When it was sent or received, as display text (\"heute, 08:23\")."
    },
    "subject": {
      "type": "string",
      "description": "Subject line."
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "description": "Plain-text body; line breaks are kept."
    },
    "clamp": {
      "type": "integer",
      "minimum": 3,
      "description": "Show at most about this many lines; longer messages get «Ganze Nachricht anzeigen» (no script: a `<details>` toggle). Use it where the message is context for a task, e.g. above a reply."
    },
    "moreLabel": {
      "type": "string",
      "default": "Ganze Nachricht anzeigen",
      "description": "Label of the toggle for clamped messages."
    }
  }
}

Markup & states

Root: article.message — usable without render() by writing the markup directly.

Attributes

AttributeValuesDefaultDescription
data-directionin | out—Who wrote it; out adds the accent edge.

Parts

PartDescription
.message__labelSmall label with icon ("Anfrage", "Antwort").
.message__headFrom, to, date and subject.
.message__bodyPlain text, white-space: pre-wrap.
.message[data-clamp] / .message__moreClamped body (--message-lines) with a <details> toggle that lifts the clamp.

Accessibility

  • An <article> labelled by its subject (or sender), so screen readers can jump between messages.
  • From/To are announced with their labels ("Von", "An"); the date is part of the header text.
  • The direction is in the label text, not only in the colour of the edge.

Guidance

DoShow the outgoing message in the review exactly as it will be sent.
DoKeep the original inquiry visible while someone writes the reply.
Don'tDon't render HTML mail bodies here; convert to text on the server.
Don'tDon't use it for chat-like notes between team members — use a note.

Related: Coach note · Card · Form field