stack icon indicating copy to clipboard operation
stack copied to clipboard

Send email digests on cronjobs for emails that failed to send

Open TheCactusBlue opened this issue 10 months ago • 7 comments


[!IMPORTANT] Add cron job and route handler to send email digests for failed emails to project owners.

  • Cron Job:
    • Adds a cron job in vercel.json to trigger /api/latest/cron/send-email-digest daily.
  • Route Handler:
    • New route handler GET in route.ts to send email digests of failed emails to project owners.
    • Validates requests using CRON_SECRET from environment variables.
    • Fetches failed emails from the last 24 hours and groups them by project.
    • Sends email digests to primary contact channels of project users.
  • Email Configuration:
    • Exports getEmailConfig in emails.tsx for use in the new route handler.
  • Testing:
    • Adds tests in email-digest.test.ts to verify email digest sending behavior for failed and non-failed emails.

This description was created by Ellipsis for a5cbd6f7193352df324cbcc26352408830fca954. It will automatically update as commits are pushed.

TheCactusBlue avatar Feb 26 '25 00:02 TheCactusBlue

Deployment failed with the following error:

The `vercel.json` schema validation failed with the following message: `crons` should be array

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

vercel[bot] avatar Feb 26 '25 00:02 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-backend ❌ Failed (Inspect) Jun 12, 2025 0:20am
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2025 0:20am
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2025 0:20am

vercel[bot] avatar Feb 26 '25 00:02 vercel[bot]

😱 Found 5 issues. Time to roll up your sleeves! 😱

recurseml[bot] avatar Feb 26 '25 01:02 recurseml[bot]

Deployment failed with the following error:

The `vercel.json` schema validation failed with the following message: `crons[0]` missing required property `schedule`

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

vercel[bot] avatar Feb 26 '25 17:02 vercel[bot]

@TheCactusBlue this one's also still waiting for you

N2D4 avatar Mar 10 '25 20:03 N2D4

Some new issue(s) might be present. Please use the following link(s) to view them:

https://zeropath.com/app/issues/8ad955ea-c75a-499e-9c2b-9e97440ff3f0

Reply to this PR with @zeropath-ai followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

zeropath-ai[bot] avatar Mar 29 '25 23:03 zeropath-ai[bot]

Some new issue(s) might be present. Please use the following link(s) to view them:

https://zeropath.com/app/issues/1b8136ed-71aa-4081-b66d-cfb015911e0d

Reply to this PR with @zeropath-ai followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

zeropath-ai[bot] avatar Apr 05 '25 11:04 zeropath-ai[bot]