-
Notifications
You must be signed in to change notification settings - Fork 144
Invitation email sending (only in development and only when RESEND_API_KEY is set now) #1513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Updates to Preview Branch (invitation-email-sending) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
The migration updates the invitation workflow by adding a new token in the invite_organization_member function and integrating email sending via Resend. The most important concerns are the atomicity of the migration processes, data integrity during token updates, and potential security risks of exposing raw tokens. Overall, the changes follow project conventions and improve functionality, though clarifications on legacy migration file handling, token refresh behavior, and potential token hashing are recommended. ER Diagram:
|
- Added RESEND_API_KEY to .env.template - Implemented sendInvitationEmail utility to send invitation emails - Updated inviteMember action to trigger email sending after successful invitation
f6e7e2f
to
c3d13bd
Compare
This migration update adds a new invitation token to the database and integrates email sending using Resend while ensuring transactions and error handling. A key concern is the synchronous email sending which may impact performance and data integrity when re-inviting users, and additional clarifications on security practices would be valuable. Overall, the changes align well with project naming conventions and migration patterns, demonstrating a thoughtful approach to schema updates. ER Diagram:
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Issue
Since I haven't set up a custom domain for Resend, this feature is enabled only in development and only when
RESEND_API_KEY
is set. 🙏In all other cases, the behavior remains unchanged from before.
Why is this change needed?
To integrate Resend's API SDK and enable email invitations during local development.
What would you like reviewers to focus on?
Testing Verification
[email protected]
(google account)[email protected]
verification:
What was done
🤖 Generated by PR Agent at c3d13bd
sendInvitationEmail
utility and integrate into invite flowRESEND_API_KEY
setinvite_organization_member
now returns invitation token in responseresend
package and related dependenciesRESEND_API_KEY
to.env.template
Detailed Changes
4 files
Integrate invitation email sending after invite action
Add utility to send invitation emails via Resend
Update invite_organization_member to return invitation token
Migration: add token return to invite_organization_member
2 files
Add placeholder migration for production compatibility
Add placeholder migration for production compatibility
1 files
Expand tests for invitation token and error handling
1 files
Add RESEND_API_KEY to environment template
2 files
Add resend package to dependencies
Update lockfile for resend and related packages
Additional Notes