# Email (/docs/components/renderings/email)

> Spec: written ahead of the package. Not in the published packages: email

> Six kinds of mail a product sends, drawn from the Product record and one event, each in the product's Theme with a plain-text twin.

`email(kind, product, event)` returns one message: `{ subject, html, text }`. The HTML is a table layout with its styles inline, in the product's Theme, because mail clients drop a stylesheet. The text is the same message without markup.

## What it renders

| Kind | Sent when | Reads from the event |
| --- | --- | --- |
| `welcome` | A key is issued | The key prefix and the first call |
| `usage` | A usage threshold is crossed | The calls used and the plan's limit |
| `limit` | The plan's limit is reached | The limit, the date it resets and the next plan |
| `webhook` | A webhook endpoint keeps failing | The endpoint, the last status and the retry count |
| `plan` | The plan changes | The old and the new plan |
| `billing` | A charge fails | The amount and the payment page |

Every kind reads the product's name, Theme and dashboard address from the [Product record](https://next.mdxui.dev/docs/components/product-record), so no message names a plan the pricing page does not.

## How it maps

startupbuilder.dev's [Template](https://startupbuilder.dev/business/nouns/template) renders "a Message, Document, or Page". Each kind of mail here is the Message rendering of one Template, filled from the event's records.

## Status

**Spec · email.**

`email` is not in `@mdxui/site@7.0.0-alpha.0`, and no Section type renders inside a message. Sending is the host's: the function returns the message and never sends it.

## Related

  - [The Product record](https://next.mdxui.dev/docs/components/product-record): What every message reads.
  - [Template](https://next.mdxui.dev/docs/components/template): A Message is one of its renderings.
  - [Renderings](https://next.mdxui.dev/docs/components/renderings): Every output format of one record.

