slackBotExample
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This Val processes incoming appointment emails and publishes a job (via Upstash QStash) to our dashboard backend.
- Source:
email.ts
parses subject/body to extractpatient
,firstApptTime
,firstApptProvider
, and an optionalreviewUrl
. - Publish: Sends a JSON payload to
https://outreach-dashboard.vercel.app/new-pt
(via QStash publish URL). Our Next.js App Router handlesPOST /new-pt
to insert an outbox row and kick off Slack outreach. - Cancel path note: The code defines a
CANCEL_URL
, but no/cancel
route exists in this repo yet. - Reliability: QStash ensures delivery and retries; our app’s outbox workflow is idempotent.
- Edit code locally in this folder.
- Publish changes:
pnpm vt:push:slack-bot
- Pull latest remote state:
pnpm vt:pull:slack-bot
- Watch and auto‑push:
pnpm vt:watch:slack-bot
- Stream logs to verify behavior:
pnpm vt:tail:slack-bot
- Open in Val Town UI:
pnpm vt:browse:slack-bot
Notes
vt push
is forceful (no confirmation). To undo, revert in Val Town UI, then pull.- If outbound network is restricted,
vt -h
/vt push
may warn about upgrades; re‑run when connected.
Email