Email Templates
Nebutra email catalog entries, public sender helpers, and preview artifacts.
Email template ownership is centralized in packages/integrations/email/src/index.ts.
EMAIL_TEMPLATE_CATALOG defines the catalog ID, public sender helper, and
preview filename for every template.
Template reference
| Catalog ID | Helper | Required payload highlights |
|---|---|---|
welcome | sendWelcomeEmail | to, firstName, orgName |
order-confirmation | sendOrderConfirmationEmail | to, orderId, totalAmount, items |
api-key-created | sendApiKeyCreatedEmail | to, firstName, keyPrefix, keyName, plaintextKey |
quota-warning | sendQuotaWarningEmail | to, orgName, metric, used, limit, percentUsed |
team-invitation | sendInviteEmail | to, inviterName, orgName, role, inviteUrl |
magic-link | sendMagicLinkEmail | to, magicLinkUrl |
contact-form-received | sendContactFormReceivedEmail | to, name, subject |
checkout-completed | sendCheckoutCompletedEmail | to, firstName, orgName, planName |
trial-ending | sendTrialEndingEmail | to, firstName, orgName, trialEndDate |
invoice-paid | sendInvoicePaidEmail | to, orgName, invoiceId, amountPaid |
payment-failed | sendPaymentFailedEmail | to, orgName, attemptCount |
subscription-canceled | sendSubscriptionCanceledEmail | to, firstName, orgName |
upcoming-invoice | sendUpcomingInvoiceEmail | to, orgName, amountDue |
plan-changed | sendPlanChangedEmail | to, firstName, orgName, newPlan |
license-created | sendLicenseCreatedEmail | to, firstName, licenseKey, tier |
Example
import { sendInvoicePaidEmail } from "@nebutra/email";
await sendInvoicePaidEmail({
to: "[email protected]",
orgName: "Acme Corp",
invoiceId: "in_123",
amountPaid: 9900,
currency: "USD",
invoiceUrl: "https://billing.stripe.com/invoice/in_123",
});Adding or changing a template
- Add or update the public sender helper in
packages/integrations/email/src/index.ts. - Add or update the matching
EMAIL_TEMPLATE_CATALOGentry. - Regenerate or validate the preview output in
apps/mail-preview/dist. - Update
packages/integrations/email/src/__tests__/email-contract.test.tswhen the public surface changes. - Run the validation commands:
pnpm --filter @nebutra/email test
pnpm --filter @nebutra/email typecheck
pnpm mail:checkDo not edit generated preview HTML as the source of truth. Update the package catalog and sender helper first.
How is this guide?
Edit on GitHub
Last updated on