Skip to content

fix: correctly log cc emails - #2913

Merged
dguyen merged 1 commit into
mainfrom
fix/log-cc-emails-correctly
Jun 2, 2026
Merged

dguyen merged 1 commit into
mainfrom
fix/log-cc-emails-correctly

Conversation

@dguyen

@dguyen dguyen commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 2, 2026 04:38
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

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

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
prd-docs Ignored Ignored Jun 2, 2026 4:38am
prd-openpage-api Ignored Ignored Jun 2, 2026 4:38am
stg-docs Skipped Skipped Jun 2, 2026 4:38am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 84c75b74-c44b-44a9-b4db-9a3da5c42731

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/log-cc-emails-correctly

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 getEmailContext to 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.

@dguyen
dguyen merged commit d2f60b1 into main Jun 2, 2026
12 checks passed
@dguyen
dguyen deleted the fix/log-cc-emails-correctly branch June 2, 2026 05:04

This branch was previously deployed

1 inactive deployment
Preview – stg-docs — 54d6b6f9 Deployed Jun 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants