Email sending, templates, and notifications.

Supports multiple email providers via HTTP APIs: Resend, Postmark, SendGrid, and Mailgun.

Emails are rendered using Liquid templates with support for custom confirmation and admin notification templates.

Functions

f
bearerAuth
No documentation available
f
buildTemplateData

Build the data object exposed to Liquid templates. Rows booked through a package head the email by the package's name (listing_names); an order may carry several bundles beside plain rows. hidePackageMembers (set for the buyer's confirmation, not the admin notification) collapses each HIDDEN package's member rows into one package row so members aren't revealed — whatever else the order carries beside them.

f
cappedReply

Cut a provider's reply to that length, marking the cut.

f
collapsedPackageSummary

The single-row summary a hidden package collapses to for buyers: the bundle's summed price and quantity plus the widest member's dated stay (hiding members must not lose the date the buyer booked). Shared by the email body row and the SVG ticket, so the two can never disagree.

f
emailHost

Host (everything after the last @) of a validated address. The ValidEmail type guarantees a host is present, so there is no empty-host case to handle and the compiler forbids passing a raw, unvalidated string.

f
emailLocalPart

Local part (everything before the last @) of a validated address.

f
failureReason

Pull the reason out of a provider's error reply: the parsed message or the raw body, on one line, capped, and with every email-shaped value blanked. Empty when the reply body says nothing.

f
getActiveEmailConfig
No documentation available
f
getEmailConfig
No documentation available
f
isValidEmail

Whether a string is a valid email (trimmed) per EmailSchema.

f
mailgunForm
No documentation available
f
parseEmail

Parse and normalize a candidate email, returning the branded ValidEmail when it is valid or null otherwise. Use this in preference to isValidEmail when the validated address needs to be carried onward in a type-safe way.

f
registrationEmailDelivery
No documentation available
f
renderEmailContent
No documentation available
f
resetEngine

For testing: reset the engines (so filters can be re-registered after currency changes)

f
sendBulkEmails
No documentation available
f
sendEmailRequest

signal cancels the request while it is in flight. null is the everyday case: a send that nothing cancels.

f
sendNtfyError

Send an error notification to the configured ntfy URL Returns a promise so callers can await delivery if needed. Delivery failures are logged locally (via logErrorLocal) but never throw.

f
sendTestEmail
No documentation available
f
updateBusinessEmail

Updates the business email in the database. Pass empty string to clear the business email. Email is encrypted at rest.

f
validateTemplate

Validate a Liquid template by parsing it (no rendering). Returns null if valid, or an error message string if invalid.

Interfaces

I
BatchMessageOutcome

What one batch's reply said about the messages inside it.

I
BulkBatchResponse
No documentation available
I
BulkEmailPayload
No documentation available
I
EmailAttachment
No documentation available
I
EmailConfig
No documentation available
I
EmailEntry
No documentation available
I
RenderedEmailContent

Render all 3 parts (subject, html, text) using custom templates with fallback to defaults

Type Aliases

T
BulkRecipient
No documentation available
T
BuyerEntryGroup

One buyer-facing row group: a HIDDEN package's rows gather behind its name; every other row stands alone.

T
EmailDeliveryResult
No documentation available
T
EmailListing
No documentation available
T
EmailProvider
No documentation available
T
EmailRequest
No documentation available
T
ValidEmail

An email address that has passed validation (a non-empty host containing at least one dot) and been normalized (trimmed, lowercased).

Variables

v
BULK_UNSUBSCRIBE_PLACEHOLDER
No documentation available
v
buyerEntryGroups

Group an order's entries for buyer-facing rendering (the confirmation body and its SVG tickets): each hidden package's rows collapse into one group sitting where its first row was, so a mixed order conceals every hidden bundle while its other rows render normally.

v
deliverRegistrationEmail
No documentation available
v
EMAIL_PROVIDER_LABELS
No documentation available
v
EmailFormatSchema

Format-only email schema: validates an address exactly as typed, without trimming or lowercasing. Used by field validators that check raw user input (see validateEmail in #templates/fields.ts).

v
EmailSchema

Canonical email schema used across the app: local@host.tld. valibot's email action guarantees a non-empty local part and a host containing at least one dot. The input is trimmed and lowercased before validation, and the output is branded as ValidEmail so a value can only be produced by passing validation. All email validation that needs a normalized, carry-onward value goes through this (see isValidEmail / parseEmail).

v
hostEmail

The host machine's own email credentials, read from its environment, with the hook a test uses to stand a different set in front of them.

v
isEmailProvider
No documentation available
v
sendEmail
No documentation available
v
sendRegistrationEmails
No documentation available
v
sumEntryPrices

The buyer's summed price (minor units) across an order's entries.

v
sumEntryQuantities

The bundle's summed booked quantity across an order's entries.

v
VALID_EMAIL_PROVIDERS
No documentation available