feat(enterprise) send and manage org recommendations email#4219
Open
St0rmz1 wants to merge 5 commits into
Open
feat(enterprise) send and manage org recommendations email#4219St0rmz1 wants to merge 5 commits into
St0rmz1 wants to merge 5 commits into
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Previous Review Summary (commit d2f3879)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d2f3879)Status: 1 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
Files Reviewed (15 files)
Reviewed by gpt-5.4-2026-03-05 · Input: 63.7K · Output: 9.7K · Cached: 343.8K Review guidance: REVIEW.md from base branch |
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
Adds a weekly recommendations email for Enterprise organizations and the controls to manage it. Organization owners can turn the email on or off from a new Email preferences section on the organization page. When it is on, a weekly cron emails the organization's owners a short summary of how many features are set up and the top open recommendations, linking back to the Feature adoption view.
recommendations_digest_enabledflag in the organization settings JSONB (schema-types.ts). No new table is added.updateRecommendationsDigesttRPC mutation that toggles the flag, plus theuseUpdateRecommendationsDigesthook. The toggle writes a single JSONB key withjsonb_set(or removes it) instead of rewriting the whole settings object.recommendationsDigest.htmltemplate and asendRecommendationsDigestEmailhelper inemail.ts, arecommendations-digest.tslibrary that builds each org's payload fromgetOrganizationRecommendations, resolves the owner recipients, and sends, and anenterprise-recommendations-digestcron registered invercel.jsonto run Mondays at 09:00 UTC.transactional_email_logso cron overlap or retries do not produce duplicates. The claim is released if the send fails so a later run can retry.settings ->> 'recommendations_digest_enabled' = 'true') rather than loading every Enterprise org.email-testing-router.tsso it renders on the admin email testing page, plus a row inemails/AGENTS.md.Verification
/admin/email-testing).Visual Changes
Two surfaces changed: the new Email preferences card on the organization page (owner-only), and the new recommendations email template. Screenshots to add:
Reviewer Notes
transactional_email_log(no new table). The key isorganizationId:userId:weekMonday, so it does not contain recipient email addresses. It is best effort: a send that succeeds at the provider but fails to record the marker would not be retried that week.