Spec: Written ahead of the package. Not in 7.0.0-alpha.0: email7.0.0-alpha.0

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

KindSent whenReads from the event
welcomeA key is issuedThe key prefix and the first call
usageA usage threshold is crossedThe calls used and the plan's limit
limitThe plan's limit is reachedThe limit, the date it resets and the next plan
webhookA webhook endpoint keeps failingThe endpoint, the last status and the retry count
planThe plan changesThe old and the new plan
billingA charge failsThe amount and the payment page

Every kind reads the product's name, Theme and dashboard address from the Product record, so no message names a plan the pricing page does not.

How it maps

startupbuilder.dev's 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

On this page