@comforthub/emails
v0.3.0
Published
React Email templates for Comfort Hub: Resend templates rendered at send time.
Readme
@comforthub/emails
Transactional email templates for Comfort Hub, built with React Email. The package ships compiled JS and type declarations; templates take real props and are rendered at send time.
Note: this README is published to npm. The source repository is private, so keep internal detail — vendor status, operational notes, contributor instructions — in
CLAUDE.md, which is not part of the package.
Install
npm install @comforthub/emailsreact and react-dom are peer dependencies: the caller owns them, so a
consumer never ends up with two React copies.
Use
import { Resend } from 'resend';
import { Transaction } from '@comforthub/emails';
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'Comfort Hub <[email protected]>',
to: [customer.email],
subject: `Invoice ${invoice.number} from Comfort Hub`,
react: Transaction({ /* real values — see the exported prop types */ }),
});Pass the element to react: rather than pre-rendering: Resend derives the
plain-text part from it as well.
From Deno or a Supabase Edge Function, pin an exact version:
import { Transaction } from 'npm:@comforthub/[email protected]';Exports
Customer templates: Transaction, Receipt, AppointmentReminder,
BookingInvitation, MaintenanceReminder, WorkOrderConfirmation, and the
DetailRow type.
Internal (staff-facing) templates: StockingOrder, OpsAlert, and the
OpsAlertProps, OpsSeverity, OpsEventStatus, OpsTimelineEvent,
OpsBreakdownRow and OpsQuery types. These carry a charcoal accent and no
unsubscribe link.
If the caller needs HTML and text strings rather than an element, render both from one element:
import { render } from '@react-email/render';
import { OpsAlert } from '@comforthub/emails';
const element = OpsAlert({ /* … */ });
const html = await render(element);
const text = await render(element, { plainText: true });The barrel is the entire public surface. Internal modules are unreachable
through exports and change without a major bump. Renaming or removing an
export, renaming a prop, or making an optional prop required is breaking;
copy, colour and spacing changes are not.
Compatibility
Rendered output targets Gmail, Apple Mail, iOS Mail and Outlook. Templates carry an Outlook/Word width override, emitted by the shell so it survives rendering by the caller.
Not yet verified in a live Outlook client.
Licence
Proprietary — see LICENSE. Published for Comfort Hub's own services; no
licence is granted to third parties.
