Skip to content

CS-60 [Improvement] [Feature] - Send onboarding email for new employee#2102

Open
github-actions[bot] wants to merge 4 commits intomainfrom
chas/send-onboarding-email-to-employee
Open

CS-60 [Improvement] [Feature] - Send onboarding email for new employee#2102
github-actions[bot] wants to merge 4 commits intomainfrom
chas/send-onboarding-email-to-employee

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 4, 2026

This is an automated pull request to merge chas/send-onboarding-email-to-employee into dev.
It was created by the [Auto Pull Request] action.

@vercel
Copy link

vercel bot commented Feb 4, 2026

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

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Feb 4, 2026 5:13pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped Feb 4, 2026 5:13pm

Request Review

@cursor
Copy link

cursor bot commented Feb 4, 2026

PR Summary

Medium Risk
Adds an email-sending side effect to the member-creation path and changes invite-link generation based on environment variables, which could impact onboarding deliverability or link correctness but does not alter auth/permissions logic.

Overview
New members added via the “add employee without invite” flow now receive an onboarding/invite email. The server action addEmployeeWithoutInvite fetches the org name, builds an environment-dependent invite link, and calls sendInviteMemberEmail; email failures are treated as non-fatal and surfaced via emailSent/emailError in the response.

The invite UI (InviteMembersModal) now tracks partial success: if the member is created but email sending fails, it shows a warning toast listing affected emails.

Updates .env.example to point NEXT_PUBLIC_PORTAL_URL at http://localhost:3002.

Written by Cursor Bugbot for commit 602c001. This will update automatically on new commits. Configure here.

@chasprowebdev chasprowebdev changed the title [dev] [chasprowebdev] chas/send-onboarding-email-to-employee CS-60 [Improvement] [Feature] - Send onboarding email for new employee Feb 4, 2026
@linear
Copy link

linear bot commented Feb 4, 2026

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


const domain = isProdEnv ? 'app.trycomp.ai' : 'localhost:3002';
const inviteLink = `${protocol}://${domain}/${organizationId}`;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invite link uses wrong domain

High Severity

inviteLink is built from a hardcoded domain (app.trycomp.ai or localhost:3002) based on NEXT_PUBLIC_PORTAL_URL string matching, instead of using the actual configured portal base URL. This can send employees/contractors to the admin app (where they may be blocked) or to localhost in non-prod environments.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants