Email templates
Manage the confirmation emails new signups receive, including variables and react-email authoring.
When someone joins a waitlist, UseWait sends them a confirmation email. Templates are plain HTML documents with per-subscriber variables, and can be linked to one or more waitlists.
Variables
Both subject and html may use these placeholders; they are substituted per subscriber at send time, with values HTML-escaped:
| Variable | Value |
|---|---|
{{waitlistName}} |
Name of the waitlist the subscriber joined |
{{description}} |
Waitlist description |
{{position}} |
The subscriber’s position, rendered as #42 |
{{referralLink}} |
The subscriber’s personal referral link |
Unknown {{variables}} are left as-is; only the documented ones are substituted.
Create a template
curl -X POST https://usewait.com/api/v1/email-templates \
-H "Authorization: Bearer uw_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome",
"subject": "You are in: {{waitlistName}}",
"html": "<!doctype html><html><body>...position {{position}}, share {{referralLink}}...</body></html>",
"waitlistIds": ["<waitlist-uuid>"]
}'
Fields
namestring
Template name, 1-100 characters.
stringsubjectstring
Email subject, may use variables, max 200 characters.
stringhtmlstring
Complete email HTML document. Inline styles only, max content width around 560-600px, max 200 KB.
stringwaitlistIds?string[]
Waitlists this template is linked to. New signups on a linked waitlist receive it. When provided on update, replaces the full assignment set.
string[]Authoring with react-email
You can build templates with react-email instead of writing raw HTML. Put the literal variable strings in your JSX, render to static HTML, and submit that HTML:
import { Html, Body, Container, Heading, Text, render } from "@react-email/components";
function WelcomeEmail() {
return (
<Html>
<Body style={{ background: "#f8fafc", fontFamily: "sans-serif" }}>
<Container style={{ maxWidth: 560, background: "#fff", padding: 32 }}>
<Heading>Welcome to {"{{waitlistName}}"}</Heading>
<Text>You are {"{{position}}"} on the list.</Text>
<Text>Move up by sharing: {"{{referralLink}}"}</Text>
</Container>
</Body>
</Html>
);
}
const html = await render(<WelcomeEmail />, { pretty: true });
// POST { name, subject, html } to /api/v1/email-templates
The API stores final HTML only, so render on your side before calling create or update. react-email’s output (a full document with inline styles) matches the expected format exactly.
List, read, update, delete
curl https://usewait.com/api/v1/email-templates \
-H "Authorization: Bearer uw_live_YOUR_KEY"curl https://usewait.com/api/v1/email-templates/TEMPLATE_ID \
-H "Authorization: Bearer uw_live_YOUR_KEY"curl -X PATCH https://usewait.com/api/v1/email-templates/TEMPLATE_ID \
-H "Authorization: Bearer uw_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "subject": "Updated: {{waitlistName}}" }'curl -X DELETE https://usewait.com/api/v1/email-templates/TEMPLATE_ID \
-H "Authorization: Bearer uw_live_YOUR_KEY"- The list response includes a
formatobject with this same variable contract, so agents can self-document. - The list omits
html; the single-templateGETincludes it. PATCHis partial: only the fields you send change. SendingwaitlistIdsreplaces the whole linked set atomically.