Try to retain users who did not subscribe#485
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIntroduces a subscribe-reminder email system: new HTML template and mailer metadata, a daily cron job that emails eligible free-plan users in their first post-onboarding week, a nullable Changes
Sequence DiagramsequenceDiagram
participant Scheduler as Cron Scheduler
participant TaskMgr as TaskManager Service
participant DB as Database
participant Mailer as Mailer Service
participant UserSvc as User Service
Scheduler->>TaskMgr: invoke remindUsersToSubscribe() @ 10:00
TaskMgr->>DB: Query users (PlanCode.none, onboarded, created ~1 week, no subscribeReminderSentOn)
DB-->>TaskMgr: return user list
alt users found
loop per user (bounded concurrency)
TaskMgr->>Mailer: send SubscribeReminder(email, subscribeUrl)
Mailer-->>TaskMgr: success / failure
alt success
TaskMgr->>UserSvc: set subscribeReminderSentOn(timestamp)
UserSvc->>DB: persist timestamp
else failure
TaskMgr->>TaskMgr: log error for user
end
end
else no users
TaskMgr->>TaskMgr: exit early
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@backend/apps/cloud/src/user/entities/user.entity.ts`:
- Around line 277-279: The entity property subscribeReminderSentOn is declared
with type: 'timestamp' but the migration creates the column as DATETIME; change
the column definition in the migration that adds the subscribe_reminder (the
2026_03_10_subscribe_reminder.sql migration) to use TIMESTAMP (or TIMESTAMP
NULL) instead of DATETIME so it matches the User entity's
subscribeReminderSentOn and the pattern used by
evWarningSentOn/noEventsReminderSentOn; ensure NULLability and any default
clauses in the SQL match the entity declaration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3fdfaa84-b1be-46a6-9037-a5bed4393b5d
📒 Files selected for processing (6)
backend/apps/cloud/src/common/templates/en/subscribe-reminder.htmlbackend/apps/cloud/src/mailer/letter.tsbackend/apps/cloud/src/mailer/mailer.service.tsbackend/apps/cloud/src/task-manager/task-manager.service.tsbackend/apps/cloud/src/user/entities/user.entity.tsbackend/migrations/mysql/2026_03_10_subscribe_reminder.sql
Changes
If applicable, please describe what changes were made in this pull request.
Community Edition support
Database migrations
Documentation
Summary by CodeRabbit