Skip to content

Notifications & Email

The Booking Kit includes email templates and notification job helpers for the booking lifecycle.

import {
sendConfirmationEmail,
sendReminderEmail,
sendCancellationEmail,
sendRescheduleEmail,
} from "@thebookingkit/core";
// Each function takes a payload and an EmailAdapter
await sendConfirmationEmail(
{
bookingId: "...",
customerName: "Alice",
customerEmail: "alice@example.com",
eventTitle: "30-Min Consultation",
startsAt: new Date("2026-03-10T14:00:00Z"),
endsAt: new Date("2026-03-10T14:30:00Z"),
timezone: "America/New_York",
providerName: "Dr. Smith",
location: "123 Main St",
},
emailAdapter,
);
TemplateWhen sent
CONFIRMATION_EMAIL_HTML/TEXTAfter booking is confirmed
REMINDER_EMAIL_HTMLBefore appointment (configurable hours)
CANCELLATION_EMAIL_HTMLWhen booking is cancelled
RESCHEDULE_EMAIL_HTMLWhen booking is rescheduled
import { interpolateTemplate } from "@thebookingkit/core";
const html = interpolateTemplate(CONFIRMATION_EMAIL_HTML, {
customerName: "Alice",
eventTitle: "Consultation",
date: "March 10, 2026",
time: "2:00 PM",
providerName: "Dr. Smith",
// ...
});
import { syncBookingToCalendar, deleteBookingFromCalendar } from "@thebookingkit/core";
// Create a calendar event for a booking
await syncBookingToCalendar(bookingPayload, calendarAdapter);
// Remove calendar event on cancellation
await deleteBookingFromCalendar(deletePayload, calendarAdapter);
import { generateICSAttachment } from "@thebookingkit/core";
const ics = generateICSAttachment({
title: "Consultation with Dr. Smith",
start: new Date("2026-03-10T14:00:00Z"),
end: new Date("2026-03-10T14:30:00Z"),
location: "123 Main St",
});
// Returns an ICS file string for email attachment
import { formatDateTimeForEmail, formatDurationForEmail } from "@thebookingkit/core";
formatDateTimeForEmail(new Date("2026-03-10T14:00:00Z"), "America/New_York");
// "Tuesday, March 10, 2026 at 9:00 AM EST"
formatDurationForEmail(30); // "30 minutes"
formatDurationForEmail(90); // "1 hour 30 minutes"