Skip to content
Skills Library
Programming · Building & coding

mail-template

/mail-template

Add or change one transactional email LangWatch sends — the props schema, the fixtures, the subject, the component on the shared expressive layout, the registry line, and the bound scenario. Covers the preview studio (pnpm --filter @langwatch/mail dev), why mail uses the expressive design system rather than the application's, how the dark cut is declared, and the render-versus-send split that keeps react-email off a worker's boot graph. Use whenever someone says 'add an email', 'change the wording of the invite mail', 'the reset email looks wrong', 'preview the emails', 'a new notification ema

Repository
langwatch ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
1
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What to check before installing
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Add or change one transactional email LangWatch sends — the props schema, the fixtures, the subject, the component on the shared expressive layout, the registry line, and the bound scenario. Covers the preview studio (pnpm --filter @langwatch/mail dev), why mail uses the expressive design system rather than the application's, how the dark cut is declared, and the render-versus-send split that keeps react-email off a worker's boot graph. Use whenever someone says 'add an email', 'change the wording of the invite mail', 'the reset email looks wrong', 'preview the emails', 'a new notification ema

Triggers from the description

s boot graph. Use whenever someone sayschange the wording of the invite mailthe reset email looks wrongpreview the emails

Arguments

/mail-template <template id or what the message says>
Original author description

Add or change one transactional email LangWatch sends — the props schema, the fixtures, the subject, the component on the shared expressive layout, the registry line, and the bound scenario. Covers the preview studio (pnpm --filter @langwatch/mail dev), why mail uses the expressive design system rather than the application's, how the dark cut is declared, and the render-versus-send split that keeps react-email off a worker's boot graph. Use whenever someone says 'add an email', 'change the wording of the invite mail', 'the reset email looks wrong', 'preview the emails', 'a new notification ema

How it works

  1. The five parts, in one file
  2. Expressive, not productive
  3. The dark cut
  4. Traps
  5. Check it
Original SKILL.md headings · 72 lines, 525 words
SKILL.md preview
---
name: mail-template
description: Add or change one transactional email LangWatch sends — the props schema, the fixtures, the subject, the component on the shared expressive layout, the registry line, and the bound scenario. Covers the preview studio (pnpm --filter @langwatch/mail dev), why mail uses the expressive design system rather than the application's, how the dark cut is declared, and the render-versus-send split that keeps react-email off a worker's boot graph. Use whenever someone says 'add an email', 'change the wording of the invite mail', 'the reset email looks wrong', 'preview the emails', 'a new notification email', or a template renders without its link.
user-invocable: true
argument-hint: "<template id or what the message says>"
---

# Write a LangWatch email

Everything is in `packages/mail/src/templates/`. Read `packages/mail/README.md` first:
it is the contract. This is what it does not say.

## The five parts, in one file

`defineTemplate({ id, title, sentWhen, schema, subject, Component, fixtures })`, then one
line in `src/templates/index.ts`. Miss the line and
`__tests__/mail-templates.unit.test.tsx` fails — it reads the barrel's source against the
folder, so a template cannot go missing quietly.

Types come from the zod schema with `infer`. Never declare both.

## Expressive, not productive

Mail uses the **expressive** system (the marketing site and the front door), never the
**productive** one (the application). Concretely: build on `EmailLayout` and its
`Paragraph` / `PrimaryButton` / `DetailTable` / `TintPanel` / `CodeBlock` / `InlineLink`, plus,
for digests and tables, `ActionRow`, `DataTable`, `CountTiles`, `PlainBlock`, `HighlightedCode`,
`Muted` and `FinePrint` (all exported by `email-layout.tsx`).
Write no colour of your own. The application's `#ED8926` in a rendered mail fails a test,
on purpose.

The primary action is an **ink pill**, not an orange slab. The brand orange lives in
details. Do not "fix" this.

## The dark cut

Dark mode is declared once, in the `STYLESHEET` of `email-layout.tsx`: each layout part carries a
class (`lw-text`, `lw-panel`, `lw-table-cell`, ...) and a `@media (prefers-color-scheme: dark)`
rule recolours it from the `dark` palette. A new building block takes an existing class or adds a
class and its dark rule there. Inline-only paint has no dark cut: do not add it in a template.

## Traps

- **Adjacent JSX text splits.** `Message from {name}` renders `Message from <!-- -->Jane`,
  so a `toContain("Message from Jane")` fails. Interpolate the whole string:
  ``{`Message from ${name}`}``.
- **No flexbox, no percentage-width `div`.** Outlook renders neither. Meters and columns
  are nested table cells — see `UsageLimitEmail`'s bar.
- **`EmailContent` has no `text` field.** `renderMailTemplate` returns one and the tests
  assert it, but the senders do not send it yet. Do not add it here: that is transport
  work in the notification module's channels
  (`modules/notification/process/src/channels/`: `ses/`, `smtp/` and the HTTP SendGrid and
  Resend channels, via `email-gateway-channels.registry.ts`). The injected `MailSender` is
  `packages/mail/src/email-sender.ts`.
- **No remote web font.** A font fetch from a mail client is an open-tracking pixel. Body and
  headings use one system sans stack (`BODY_FONT` in `email-layout.tsx`); Sentient belongs to the
  internal-console design system, not mail.
- **Render versus send.** A message whose envelope belongs to a process (BCC fan-out,
  unsubscribe footer, no-reply `To`) exports a render function and gains a method on
  `MailRender` (`packages/mail/src/mail-render.ts`). Only a whole send gets a `sendXEmail`. Getting this wrong puts
  react-email on a worker's boot graph, which
  `packages/architecture-enforcer/tests/frontend-boundary.unit.test.ts` will catch.
- **Links arrive built.** A template never assembles a URL from a base host it read
  itself. The module that owns the destination passes the link.

## Check it

```bash
pnpm --filter @langwatch/mail dev          # the studio, http://localhost:5566
pnpm --filter @langwatch/mail test    # add -u after a deliberate copy change
cd packages/mail && pnpm --silent typecheck
```

Snapshots are legitimate here — the rendered email is the product — but update them only
when you meant to change the words. Scenarios live in
`packages/mail/specs/mail-templates.feature` and each needs a `@unit` tag plus a verbatim
`/** @scenario "<title>" */` above the `it(`.

Versions

The database has no other skills named mail-template.

Database snapshot: 13.11.2026 · package version bdb2b91c5a2b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100add-email
    Add a transactional email to a TurbineKit project — a React Email template with text in every locale, typed props, and a send call. Use when the product must email people.
  • 100mailsim
    Catch, read and assert on the emails the LangWatch stack sends, using mailsim, haven's local mail sink. Use when someone says 'haven mail', 'did the email send', 'where is the verification mail', 'invite link', 'wait for the email', 'mailsim', 'the mail sink', 'haven sim mail',…
  • 100lunora-setup-mail
    Adds transactional email to a Lunora app with the `mail` registry item (`@lunora/mail`). Covers the server-only `internal.mail.sendEmail` / `queueEmail` actions, the `SEND_EMAIL` Cloudflare Email Workers binding, Resend via `RESEND_API_KEY`, `react-email` templates via…
  • 100spring-mail
    Spring Mail for sending emails in Spring Boot 3.x. Covers JavaMailSender, SimpleMailMessage, MimeMessage, HTML emails, attachments, templates (Thymeleaf/FreeMarker), async sending, and testing. USE WHEN: user mentions "spring mail", "JavaMailSender", "email Spring Boot", "send…
  • 100form-email
    Use when asked to design an email template, newsletter, drip campaign email, transactional email, or any HTML email asset. Examples: "design a welcome email", "create a newsletter template", "make an onboarding email sequence", "design a password reset email", "build an email campaign".
  • 95email-template-builder
    Build email template systems with React Email or MJML: responsive layouts, dark mode, multi-provider sending, and spam score optimization. Use when setting up transactional email, building email design systems, or debugging deliverability.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.