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
buildSvgTicketData

Build SVG ticket data from an email entry (non-PII only)

f
buildTemplateData

Build the data object exposed to Liquid templates

f
buildTicketAttachments

Generate SVG ticket attachments for all entries

f
getBusinessEmailFromDb

Gets the business email from the database (uses settings cache). Returns decrypted email or empty string if not set.

f
getEmailConfig

Read email config from DB settings. Falls back to business email for fromAddress. Returns null if not configured.

f
getHostEmailConfig

Read host-level email config from environment variables. Returns null if not fully configured.

f
isEmailProvider

Type guard: checks if a string is a valid EmailProvider

f
isValidBusinessEmail

Validates a basic email format: something@something.something

f
normalizeBusinessEmail

Normalizes email: trim and lowercase

f
renderEmailContent

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

f
renderTemplate

Render a single Liquid template string with the given data

f
resetEngine

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

f
sendEmail

Send a single email via the configured provider. Logs errors, never throws. Returns HTTP status or undefined on non-HTTP errors.

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
sendRegistrationEmails

Send registration confirmation + admin notification emails. Entries is an array because one registration can cover multiple events. Silently skips if email is not configured. Attaches one SVG ticket per entry to the confirmation email.

f
sendTestEmail

Send a test email to the business email address. Returns HTTP status or undefined on non-HTTP errors.

f
updateBusinessEmail

Updates the business email in the database and invalidates the settings cache. 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.

Type Aliases

T
EmailAttachment

A base64-encoded email attachment

T
EmailConfig
No documentation available
T
EmailEntry

Attendee + event pair for email rendering

T
EmailEvent

Event data needed for email rendering (extends webhook event with display fields)

T
EmailProvider

Union of all supported email provider keys, derived from the PROVIDERS map

T
TemplateData

Data object passed to Liquid templates

Variables

v
EMAIL_PROVIDER_LABELS

Display labels for email providers — keys must match EmailProvider

v
VALID_EMAIL_PROVIDERS

Valid provider names, derived from the PROVIDERS map