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 IDHelperRequired payload highlights
welcomesendWelcomeEmailto, firstName, orgName
order-confirmationsendOrderConfirmationEmailto, orderId, totalAmount, items
api-key-createdsendApiKeyCreatedEmailto, firstName, keyPrefix, keyName, plaintextKey
quota-warningsendQuotaWarningEmailto, orgName, metric, used, limit, percentUsed
team-invitationsendInviteEmailto, inviterName, orgName, role, inviteUrl
magic-linksendMagicLinkEmailto, magicLinkUrl
contact-form-receivedsendContactFormReceivedEmailto, name, subject
checkout-completedsendCheckoutCompletedEmailto, firstName, orgName, planName
trial-endingsendTrialEndingEmailto, firstName, orgName, trialEndDate
invoice-paidsendInvoicePaidEmailto, orgName, invoiceId, amountPaid
payment-failedsendPaymentFailedEmailto, orgName, attemptCount
subscription-canceledsendSubscriptionCanceledEmailto, firstName, orgName
upcoming-invoicesendUpcomingInvoiceEmailto, orgName, amountDue
plan-changedsendPlanChangedEmailto, firstName, orgName, newPlan
license-createdsendLicenseCreatedEmailto, 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

  1. Add or update the public sender helper in packages/integrations/email/src/index.ts.
  2. Add or update the matching EMAIL_TEMPLATE_CATALOG entry.
  3. Regenerate or validate the preview output in apps/mail-preview/dist.
  4. Update packages/integrations/email/src/__tests__/email-contract.test.ts when the public surface changes.
  5. Run the validation commands:
pnpm --filter @nebutra/email test
pnpm --filter @nebutra/email typecheck
pnpm mail:check

Do 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

On this page