added cron job to for daily failed email digest#714
Merged
N2D4 merged 11 commits intohexclave:devfrom Jun 17, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
@BilalG1 is attempting to deploy a commit to the Stack Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
😱 Found 2 issues. Time to roll up your sleeves! 😱 🗒️ View all ignored comments in this repo
|
N2D4
requested changes
Jun 17, 2025
Contributor
There was a problem hiding this comment.
PR Summary
Added daily failed email digest functionality with cron job and secure API endpoint to notify tenant owners of delivery issues.
- New internal endpoint
/api/latest/internal/failed-emails-digestwithSTACK_CRON_SECRETauthorization - Raw SQL query in
apps/backend/src/app/api/latest/internal/failed-emails-digest/crud.tsxusing dynamic parameters without proper object safety - Vercel cron job configured to run daily at midnight
- E2E tests in
apps/e2e/tests/backend/endpoints/api/v1/internal/failed-emails-digest.test.tsverifying authorization and email processing - Environment variable
STACK_CRON_SECRETadded to.env.developmentfor local testing
5 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
N2D4
approved these changes
Jun 17, 2025
Contributor
N2D4
left a comment
There was a problem hiding this comment.
Feel free to merge when tests pass!
N2D4
added a commit
to willothy/stack
that referenced
this pull request
Jun 23, 2025
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
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.
Important
Add cron job and API endpoint for daily failed email digest with authorization and tests.
vercel.jsonto trigger/api/latest/internal/failed-emails-digestdaily at midnight.route.tsto handle failed email digests, requiringSTACK_CRON_SECRETfor authorization.getFailedEmailsByTenancyfromcrud.tsxto fetch failed emails from the last 24 hours.sendEmail.STACK_CRON_SECRETto.env.developmentfor authorization.failed-emails-digest.test.tsfor authorization and successful processing of failed emails.This description was created by
for c4ef137. You can customize this summary. It will automatically update as commits are pushed.