OUT-3735 | Reminder copy helper: getReminderEmailDetails#1230
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryIntroduces
Confidence Score: 4/5Safe to merge — the helper is pure, isolated, and fully tested; the only open question is whether body copy for company recipients should differ from individual copy The new function is a straightforward data mapping helper with no side effects. The brandName fallback and groupTerm interpolation are both correct, and the return type's use of Record<TaskReminderType, …> ensures compile-time exhaustiveness. The one open question — whether body copy should adapt when isCompanyRecipient=true — has no current wrong behavior since the snapshots lock in the existing output, but the inconsistency between header and body phrasing for company emails deserves a brief clarification before the code grows. The body strings in notification.helpers.ts always use "you" / "assigned to you" regardless of isCompanyRecipient; worth a quick cross-check against the PRD to confirm this is intentional Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["getReminderEmailDetails(workspace, task, isCompanyRecipient)"] --> B["portalPrefix = brandName ?? '' + ' portal:' trimStart()"]
A --> C["labels = getWorkspaceLabels(workspace)"]
A --> D{isCompanyRecipient?}
D -- true --> E["header = 'A task was assigned to your {groupTerm}'"]
D -- false --> F["header = 'A task was assigned to you'"]
E --> G["Build Record<TaskReminderType, EmailFields>"]
F --> G
B --> G
G --> H["NO_DUE_DATE_3D"]
G --> I["NO_DUE_DATE_7D"]
G --> J["DUE_DATE_BEFORE_3D"]
G --> K["DUE_DATE_TODAY"]
G --> L["DUE_DATE_OVERDUE_3D"]
G --> M["DUE_DATE_OVERDUE_7D"]
H & I & J & K & L & M --> N["{ subject, header, title, body, ctaParams: { taskId } }"]
Reviews (1): Last reviewed commit: "feat(OUT-3735): add getReminderEmailDeta..." | Re-trigger Greptile |
| > => { | ||
| const portalPrefix = `${workspace.brandName ?? ''} portal:`.trimStart() | ||
| const labels = getWorkspaceLabels(workspace) | ||
| const header = isCompanyRecipient ? `A task was assigned to your ${labels.groupTerm}` : 'A task was assigned to you' |
There was a problem hiding this comment.
Body copy never adapts to
isCompanyRecipient
The header correctly branches on isCompanyRecipient, but all six body strings are hardcoded with "you"/"assigned to you" phrasing. When isCompanyRecipient=true, a reader sees header "A task was assigned to your company" alongside body "…you have a task '...' assigned to you that's still pending completion" — the "you" in the body contradicts the company-assignment framing in the header. If the body is intentionally addressed to the individual even for company assignments (a common B2B pattern), a brief comment explaining that design decision would prevent future confusion.
b4fdbe6 to
d3b94ad
Compare
Returns subject/header/title/body/ctaParams for each of the six TaskReminderType variants. Header branches on whether the recipient is a company (uses workspace groupTerm) or an individual. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cc71a88 to
ff14b29
Compare
|
Deployment failed with the following error: Learn More: https://vercel.link/multiple-function-regions |
Summary
getReminderEmailDetails(workspace, task, isCompanyRecipient)innotification.helpers.ts— returns subject/header/title/body/ctaParams for each of the sixTaskReminderTypevariants.getWorkspaceLabels).{brandName} portal:prefix interpolated fromworkspace.brandName.getEmailDetailsrather than merging —NotificationTaskActionsand reminder types have separate lifecycles.Note: stacked on top of #1229 (OUT-3734). Base should switch to
mainonce that lands.Minor copy deviation: PRD shows
DUE_DATE_OVERDUE_7Dsubject without the{Company} portal:prefix (the other 5 have it). I included the prefix for consistency — looks like a PRD typo. Easy to drop if intentional.Test plan
TaskReminderTypevariantgroupTermfrom workspace labels flows into headerbrandNamedegrades gracefully (portal:prefix without leading whitespace)ctaParams: { taskId }emitted on every varianttsc --noEmitpasses🤖 Generated with Claude Code