Skip to content

fix: send forum watch notification recipients via BCC - #22

Merged
jmgasper merged 1 commit into
developfrom
fix/forum-notification-bcc
Oct 22, 2026
Merged

jmgasper merged 1 commit into
developfrom
fix/forum-notification-bcc

Conversation

@jmgasper

Copy link
Copy Markdown
Contributor

Problem

Forum watch notification emails exposed member email addresses. ForumsWatchNotificationService put every authorized watcher's address in the external.action.email recipients field. The email service (both email-service-v6 and legacy tc-email-service) maps that field to SendGrid to, and SendGrid sends a single message with one shared To header. Every watcher could see every other watcher's email address.

Fix

  • Watcher addresses now go only in bcc.
  • recipients (the To header) holds a single non-member address from the new NOTIFICATION_TO_EMAIL setting, which defaults to no-reply@topcoder.com. This follows the pattern already used by leave-api-v6 (LEAVE_REMINDER_TO_EMAIL).
  • If a member's address matches the To address (case-insensitive), it is removed from BCC. That address still gets the email through To, and SendGrid rejects an address repeated across To and BCC.
  • cc is never set.

This is the only email publisher in forums-api, so it covers all forum notification emails. The email service already passes bcc through to SendGrid for v3 payloads, so it needs no changes.

Config

NOTIFICATION_TO_EMAIL is optional. If it is unset or blank, no-reply@topcoder.com is used. Set it to a non-member address.

Tests

  • Updated unit and integration specs to expect watcher addresses in bcc and only the no-reply address in recipients.
  • Added regression tests: member addresses never appear in To/CC, and NOTIFICATION_TO_EMAIL is respected and removed from BCC.
  • pnpm lint, pnpm build, and jest: 22 suites passed, 3 DB-gated suites skipped (190 tests passed).

Not addressed here

SendGrid caps a single personalization at 1000 total recipients (To + CC + BCC). This limit already applied to the old to list. Challenge forums with very large auto-watched registrant lists could exceed it and would need the BCC list split into batches.

🤖 Generated with Claude Code

Forum watch notifications put every watcher's address in `recipients`,
which SendGrid renders as a single shared To header, exposing member
email addresses to everyone on the notification.

Watcher addresses now go only in `bcc`; `recipients` carries a single
non-member address from NOTIFICATION_TO_EMAIL (default
no-reply@topcoder.com), which is also removed from BCC to avoid
SendGrid's duplicate-address rejection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jmgasper
jmgasper merged commit 504f90a into develop Oct 22, 2026
2 checks passed
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