Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Nov 25, 2025

Summary by CodeRabbit

  • New Features
    • Partner invitation emails now include recipient names for improved personalization during the onboarding process.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Contributor

vercel bot commented Nov 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Nov 25, 2025 9:58pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

Added a name field to the partner invitation flow: parsed from input, passed into partner creation/enrollment, and surfaced to the invitation email payload. No public API signatures changed.

Changes

Cohort / File(s) Summary
Partner invitation update
apps/web/lib/actions/partners/invite-partner.ts
Extract name from parsed input; include name in the object passed to createAndEnrollPartner; use enrolled partner's name in the invite email payload; no exported signature changes.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client/UI
    participant Action as invitePartnerAction
    participant Service as createAndEnrollPartner
    participant Email as EmailService

    Client->>Action: submit { email, username, name, groupId }
    Note right of Action: parse input (now includes name)
    Action->>Service: createAndEnrollPartner({ email, username, name, groupId })
    Service-->>Action: enrolledPartner { id, email, username, name, ... }
    Action->>Email: sendInvite(enrolledPartner, ProgramInvitePayload(name))
    Email-->>Client: deliver invite email
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify input validation/sanitization for name where parsed.
  • Confirm createAndEnrollPartner persists/returns name.
  • Check invite email template handles missing or empty name gracefully.

Possibly related PRs

Suggested reviewers

  • TWilson023

Poem

🐰 I hop a name from form to mail,
Through action, service, trail by trail.
Enrolled and named, the invite flies,
Warm greetings sent beneath the skies. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: extracting and passing the name field from client input through invitePartnerAction.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-invite-partner-name

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f32f8ef and 953c7d5.

📒 Files selected for processing (1)
  • apps/web/lib/actions/partners/invite-partner.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-17T17:44:03.965Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2857
File: apps/web/lib/actions/partners/update-program.ts:96-0
Timestamp: 2025-09-17T17:44:03.965Z
Learning: In apps/web/lib/actions/partners/update-program.ts, the team prefers to keep the messagingEnabledAt update logic simple by allowing client-provided timestamps rather than implementing server-controlled timestamp logic to avoid added complexity.

Applied to files:

  • apps/web/lib/actions/partners/invite-partner.ts
📚 Learning: 2025-10-06T15:48:14.205Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2935
File: apps/web/lib/actions/partners/invite-partner-from-network.ts:21-28
Timestamp: 2025-10-06T15:48:14.205Z
Learning: For the network invites limit check in apps/web/lib/actions/partners/invite-partner-from-network.ts, the team accepts that concurrent invites may bypass the limit due to race conditions. Perfect atomicity is not required for this feature.

Applied to files:

  • apps/web/lib/actions/partners/invite-partner.ts
📚 Learning: 2025-11-12T22:23:10.414Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 3098
File: apps/web/lib/actions/partners/message-program.ts:49-58
Timestamp: 2025-11-12T22:23:10.414Z
Learning: In apps/web/lib/actions/partners/message-program.ts, when checking if a partner can continue messaging after messaging is disabled, the code intentionally requires `senderPartnerId: null` (program-initiated messages) to prevent partners from continuing to send junk messages. Only conversations started by the program should continue after messaging is disabled, as a spam prevention mechanism.

Applied to files:

  • apps/web/lib/actions/partners/invite-partner.ts
🔇 Additional comments (3)
apps/web/lib/actions/partners/invite-partner.ts (3)

19-20: Cleanly propagating name from input

Adding name to the parsed input keeps the invite action contract straightforward and makes it easy to thread the display name through the flow. This looks consistent with how the other fields (email, username, groupId) are handled.


59-67: Using canonical partner data for enrollment

Including name in the partner payload for createAndEnrollPartner aligns the stored partner record with what was provided by the inviter and keeps all partner-facing data flowing from a single source of truth. This is a good place to attach it.


83-105: Passing enrolledPartner.name into the email template

Using enrolledPartner.name rather than the raw input when rendering ProgramInvite is the right choice, since it relies on the persisted record and any normalization done by createAndEnrollPartner. Assuming the template already treats a missing/empty name gracefully, this change is solid.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@steven-tey
Copy link
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

✅ Actions performed

Full review triggered.

@steven-tey steven-tey merged commit 5b13e4e into main Nov 25, 2025
7 of 9 checks passed
@steven-tey steven-tey deleted the fix-invite-partner-name branch November 25, 2025 22:04
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