Skip to content

Cohost notification (P5.M7)

runCohostNotify in src/workflows/cohost-notify.ts. Fires once per booking on workflow spawn. Ports BA AAs 288017 (Brad) + 299092 (Kemar).

Why critical

The Torian Plum front desk hands out RFID keys to TP guests. The front desk staff (Vacasa employees) need to know about each Stay On The Snow booking ahead of time so the guest can pick up keys without confusion. Personnel rotates at TP so this list is built to be edited.

Trigger

  • Fires on every workflow spawn (runCohostNotify is called in the spawn-time step.do("cohost-notify", ...) block)
  • Skips if:
    • COHOST_NOTIFIED=Y info code on booking (idempotent)
    • property_config.cohost_emails is empty (no co-host configured)
    • shadow=true (workflow-level shadow mode)

What it sends

Subject: Titler New Booking — {Property} — {arrival} to {departure}

Body:

Hi — we have a new booking for {Property}.
{guestFullName}
{Property}
Arriving {arrival}
Departing {departure}
Phone: {guestPhone}
Please confirm receipt — let me know if you need anything from me.
Bill T
952-451-8482

Sent per-recipient (each cohost email gets its own send) — so a bad address doesn’t block others, and each lands in their personal inbox.

Configuration

property_config.cohost_emails is a JSON array. Currently seeded:

Propertycohost_emails
CC #223[] (no cohost)
SS #702[] (no cohost)
TP #501["brad.price@vacasa.com", "kemar.kennedy@vacasa.com"]

To update:

Terminal window
npx wrangler d1 execute stayonthesnow --remote --command="\
UPDATE property_config SET cohost_emails = '[\"newperson@vacasa.com\"]' \
WHERE property_id = 120202;"

Idempotency

After sending, setInfoItem(env, token, bookingId, "COHOST_NOTIFIED", "Y"). Future workflow spawns see the info code and skip.

If a future workflow respawn fails (rare), the worst case is one duplicate notification — TP front desk getting two emails is harmless.

Source

  • src/workflows/cohost-notify.ts
  • migrations/0033_property_cohost_emails.sql
  • Tests: test/workflows/cohost-notify.test.ts (6 cases)