Wire real email provider + finish guest_comms schedule/win_back gaps (TEL-7) - #293
Merged
Merged
Conversation
- 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
marked this pull request as ready for review
August 9, 2026 18:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SENDGRID_*andSMTP_*env vars in.env.exampleand.env.production.exampleGuestCommunicationAgent.execute()→EmailService(SendGrid → Mailgun → SES → SMTP)Scheduled
guest_comms/run0 7 * * *daily cron to agent graph anddocs/operations/cron.mdpostStayDelayHourspostStayDelayHourshas passedwin_backwinBackDaysagodays_sinceinstead of a hardcoded90Acceptance
SENDGRID_*orSMTP_*is setPOST /agents/:propertyId/guest_comms/run?triggeredBy=scheduleor manual RunTesting
vitest run src/modules/agent/guest-comms/ src/modules/agent/agent-graph.spec.ts— 48 tests passingLinear Issue: TEL-7