Skip to content

Offer optional sender email notifications - #250

Open
fortytwode wants to merge 3 commits into
NYLLON-SOFTWARE:mainfrom
fortytwode:feat/sender-email-notifications
Open

fortytwode wants to merge 3 commits into
NYLLON-SOFTWARE:mainfrom
fortytwode:feat/sender-email-notifications

Conversation

@fortytwode

@fortytwode fortytwode commented Nov 22, 2026 •

Copy link
Copy Markdown

Summary

This PR has two parts. Every new email is off by default.

Sender notifications (3b7df9a)

  • Senders can opt in to email updates for a recipient's first open or a completed intermediate turn.
  • A daily digest lists documents waiting for signatures or approvals. It needs the retention job's bearer secret and goes out at most once per UTC day.
  • The completion email can attach the signed PDF. It goes only to the current verified owner, within the attachment limit, and links to the dashboard for the audit certificate.

Common signature-request email workflows (33645ba)

  • Invitation subject and message. Templates and envelopes can carry their own invitation subject and message, which prefill when a template is used and can be edited before sending.
  • Fixed reminder schedule. Besides repeating every 1, 2, 3 or 7 days, a reminder can go out on days 3 and 7 of each signer's turn. The API accepts "reminderSchedule": "days_3_and_7", which takes precedence over reminderIntervalDays.
  • Copy recipients and ordered signing. SIGNUDOC_EMAIL_COPY_ACTIVITY=1 tells copy recipients when a request goes out, is first opened, or moves to another turn. SIGNUDOC_EMAIL_ORDERED_SIGNING_STARTED=1 tells later signers the request is underway; their signing link still arrives when their turn begins.
  • Original PDF copies. SIGNUDOC_EMAIL_SENDER_SENT_ATTACHMENT=1 sends the sender the original PDF when the request goes out. SIGNUDOC_EMAIL_SIGNER_INVITATION_ATTACHMENT=1 attaches it to invitations within the provider's limit. Signers who need an access code, an email code, or a Part 11 account still open the document through the signing page.
  • Two migrations: 20261123110000_fixed_reminder_schedule.sql and 20261123120000_invitation_copy.sql.

Verification

  • Ran the Chromium suite with sender emails enabled, including the updated signing-flow and same-time signing specs, and the focused completion test with PDF attachments enabled and disabled.
  • Tested concurrent first opens, digest deduplication and retry, fixed-schedule reminders, template invitation defaults, authorized scheduler access, and attachment recipients against PostgreSQL. Compared the emailed PDF hash with the signed PDF.
  • Ran the production build, typecheck, lint, formatting, and unit tests. Email verification used the capture driver.

Note

Add optional sender email notifications, daily digests, and invitation copy

  • Adds sender activity emails (signer viewed/signed/approved notices), a daily digest of outstanding envelopes (one per sender per UTC day), and copy-recipient/ordered-signing notices, all gated by new env flags in .env.example and driven by new email templates in domain.ts
  • Sender completion emails can attach the signed PDF when the verified owner matches the sender address; signing invitations can attach the source PDF when enabled
  • Adds editable invitation subject/message on envelopes and templates, stored via migrations invitation_copy.sql and a new PATCH handler in route.ts; drafts inherit template invitation copy
  • Adds a fixed day-3/day-7 reminder schedule alternative to interval reminders, persisted via fixed_reminder_schedule.sql and selectable in the review, detail, and bulk-send UIs
  • Sender digests run inside the envelope schedule only when the caller is authorized and SIGNUDOC_EMAIL_SENDER_DAILY_DIGEST is "1" (envelope-schedule.ts)
  • Risk: changeRemindersSchema now rejects requests that omit both reminderIntervalDays and reminderSchedule (refinement in envelope.ts); senders with account-closure requests or unverified emails are excluded from digests and attachments

Macroscope summarized ed30c9b.

Send progress updates after recorded recipient activity and let verified
senders receive a daily summary of outstanding envelopes. Allow an
opt-in signed PDF attachment on the sender's completion email.
@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@fortytwode is attempting to deploy a commit to the Basic Intelligence Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable new issues were found.

Summary

Adds optional sender emails, recipient notices, PDF attachments, fixed reminder days, and editable invitation text.

  • Senders and other recipients can get email updates as envelopes move forward.
  • The authorized retention job emails each sender a daily list of waiting envelopes.
  • A verified sender can receive the signed PDF with the completion email.
  • Senders can choose automatic reminders on days 3 and 7 of each signer’s turn.
  • Senders can add custom subject and message text to signing invitations.

No actionable new issues were found. No previous review threads were supplied.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Sender prepares envelope] --> B[Choose invitation text and reminders]
  B --> C[Send invitations]
  C --> D[Recipient opens document]
  D --> E[Optional activity notices]
  D --> F[Recipient signs or approves]
  F --> G{Anyone still waiting?}
  G -->|Yes| H[Invite next turn and send optional notices]
  H --> D
  G -->|No| I[Send completion emails]
  I --> J[Optionally attach signed PDF for verified owner]
  K[Authenticated daily job] --> L[Send due reminders]
  K --> M[Optional daily sender digest]
Loading

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

This branch has not been deployed

No deployments
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.

1 participant