Scheduled composer

Compose and send now, or flip 'Send later' to pick a date and time. Scheduling POSTs send_at to the API, which parks the message in scheduled status until it's due — a real server-side schedule, not a browser timer.

Installation

npx shadcn@latest add @handset/scheduled-composer

Usage

import { ScheduledComposer } from "@/components/handset/scheduled-composer";

<ScheduledComposer
  fromNumberId={tenant.numberId}
  to={contact.phone}
  onSent={(m) => m.status === "scheduled" ? toast("Scheduled") : toast("Sent")}
/>

Sends immediately by default; the send_at is only added when “Send later” is on. The API accepts a schedule up to 90 days out and returns the message in scheduled status with scheduled_at set. Every send carries an Idempotency-Key. Pair it with quiet-hours if you also want to block ill-timed immediate sends.

Props

Props
PropTypeDefaultDescription
fromNumberIdstring—The tenant number to send from (num_…).
tostring—Recipient in E.164.
onSent(message) => void—Called with the sent or scheduled message.
classNamestring—Merged onto the root card.