Skip to content

Approval emails for submitters; read-only review queue for the daily digest - #36

Merged
Ker102 merged 1 commit into
mainfrom
approval-mail
Dec 3, 2026
Merged

Ker102 merged 1 commit into
mainfrom
approval-mail

Conversation

@Ker102

@Ker102 Ker102 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator
  • Approval email: when a reviewer publishes a site submission, the backend sends a short plain-text email from MAIL_SENDER through Microsoft Graph (client credentials). Records in mailOutbox are claimed in a transaction (no double sends across instances), retried up to 5 times, and also flushed at startup. The address is read from Firebase Auth at send time and never stored. Inactive until MAIL_TENANT_ID, MAIL_CLIENT_ID, MAIL_CLIENT_SECRET and MAIL_SENDER are set.
  • Review queue for automation: GET /api/automation/review-queue accepts only a Google ID token (audience <origin>/api/automation) for the single service account in AUTOMATION_SERVICE_ACCOUNT. Read-only; strips owner ids; reports pending/failed mail counts. Inactive until that variable is set.
  • mailer.js added to the Cloud Run bundle.

Tests: 17 backend, 51 Python.

…eview queue

Approvals now send a short email through Microsoft Graph from the
configured mailbox. Mail is claimed in a transaction, retried up to five
times, and the address is read from Auth only when sending. Nothing is
sent until the MAIL_* settings exist.

/api/automation/review-queue answers only Google ID tokens of one
service account (AUTOMATION_SERVICE_ACCOUNT) and is read-only, for the
daily review digest.
@Ker102
Ker102 merged commit 755fafe into main Dec 3, 2026
5 checks passed
@Ker102
Ker102 deleted the approval-mail branch December 3, 2026 03:29
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