Repository navigation
fix: correctly log cc emails - #2913
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates outbound email handling to better respect organisation-level email limits and to avoid sending emails on behalf of disabled (e.g. banned) owners, with a focus on CC-related email behavior.
Changes:
- Extend
getEmailContextto expose whether the organisation owner is disabled, and use that to skip sending certain emails. - Add organisation email quota/rate metering to reminder, cancellation, and recipient-removed email flows; adjust CC behavior (e.g., don’t send “removed”/cancellation emails to CC recipients).
- Add metering for CC completion emails (but currently only for CC recipients).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/lib/server-only/recipient/set-document-recipients.ts | Meters “recipient removed” emails against org email limits; logs and drops on limit exceeded. |
| packages/lib/server-only/recipient/delete-envelope-recipient.ts | Skips removal email for CC recipients; meters removal emails against org email limits. |
| packages/lib/server-only/email/get-email-context.ts | Adds isOrganisationOwnerDisabled to the email context by selecting org owner disabled state. |
| packages/lib/jobs/definitions/internal/process-signing-reminder.handler.ts | Skips reminders for disabled owners; meters reminder emails against org email limits and drops on limit exceeded. |
| packages/lib/jobs/definitions/emails/send-signing-email.handler.ts | Skips signing invites when the envelope owner or org owner is disabled. |
| packages/lib/jobs/definitions/emails/send-document-completed-emails.handler.ts | Adds org metering for CC completion emails (but not for non-CC recipients). |
| packages/lib/jobs/definitions/emails/send-document-cancelled-emails.handler.ts | Skips for disabled owners; excludes CC recipients; meters cancellation emails per recipient against org email limits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.