Skip to content

Wire real email provider + finish guest_comms schedule/win_back gaps (TEL-7) - #293

Merged
telivity-otaip merged 3 commits into
mainfrom
cursor/guest-comms-email-schedule-c1f4
Aug 9, 2026
Merged

Wire real email provider + finish guest_comms schedule/win_back gaps (TEL-7)#293
telivity-otaip merged 3 commits into
mainfrom
cursor/guest-comms-email-schedule-c1f4

Conversation

@telivity-otaip

Copy link
Copy Markdown
Collaborator

Summary

Completes TEL-7 guest communications gaps: real email delivery when a provider is configured, scheduled pre-arrival/day-of runs, win-back generation, and honoring postStayDelayHours.

Changes

Email provider wiring

  • Document SENDGRID_* and SMTP_* env vars in .env.example and .env.production.example
  • Existing send path unchanged: approve → GuestCommunicationAgent.execute()EmailService (SendGrid → Mailgun → SES → SMTP)

Scheduled guest_comms/run

  • Add 0 7 * * * daily cron to agent graph and docs/operations/cron.md
  • Scheduled/manual runs now draft: pre-arrival, day-of, delayed post-stay, and win-back

postStayDelayHours

  • Checkout events skip immediate post-stay when delay has not elapsed
  • Daily scheduled run picks up checked-out reservations once postStayDelayHours has passed

win_back

  • Scheduled runs generate win-back drafts for guests whose departure date is exactly winBackDays ago
  • Templates use actual days_since instead of a hardcoded 90

Acceptance

  • Approving a pending decision sends real email when SENDGRID_* or SMTP_* is set
  • Pre-arrival/day-of can be produced via POST /agents/:propertyId/guest_comms/run?triggeredBy=schedule or manual Run

Testing

  • vitest run src/modules/agent/guest-comms/ src/modules/agent/agent-graph.spec.ts — 48 tests passing

Linear Issue: TEL-7

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 9, 2026 17:30
- Document SendGrid/SMTP env vars in .env.example and production template
- Add daily cron (07:00) for guest_comms: pre-arrival, day-of, delayed
  post-stay, and win-back generation
- Honor postStayDelayHours on checkout events; scheduled run picks up
  post-stay after delay elapses
- Generate win_back drafts on scheduled runs using winBackDays config
- Pass actual days_since into win-back templates
- Add scheduling helpers and unit tests for agent/models

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Conflicts in README.md and docs/test-stats.json were simple numeric
badge/count drift from parallel test additions on both branches.
Re-synced to 1447 tests / 204 files via pnpm readme:sync-tests.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip marked this pull request as ready for review August 9, 2026 18:42
@telivity-otaip
telivity-otaip merged commit 55575b7 into main Aug 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants