notifications: enable SendGrid click tracking on notification emails#56
Merged
Merged
Conversation
Notification emails set no trackingSettings, so whether SendGrid rewrites links and emits `click` events depended on the account-global tracking toggle. The notifications-dashboard already ingests those click events (SendGrid Event Webhook → email_events → email engagement analytics), so make click tracking explicit per-message instead of implicit. Open tracking is disabled on purpose: Apple Mail Privacy Protection pre-fetches the open pixel for ~half of email traffic, making opens unreliable. The dashboard intentionally ignores email opens and treats click rate as the trustworthy signal, so we don't pay for open-pixel noise. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Explicitly enable click tracking on notification emails so SendGrid rewrites links and emits
clickevents. PreviouslysendEmail.tsset notrackingSettings, so click data depended on the SendGrid account-global toggle rather than code.Why
The notifications-dashboard already has the full email-analytics pipeline: a signature-verified SendGrid Event Webhook →
email_events→ hourly aggregation intoannouncements.email_clicked+ a "top clicked links" UI. That pipeline is fed by SendGridclickevents, which only fire when click tracking rewrites links. Making it explicit here removes the implicit dependency on account settings.Open tracking is disabled on purpose: Apple Mail Privacy Protection pre-fetches the open pixel for ~half of traffic, making opens noise. The dashboard already ignores email opens and uses click rate as the trustworthy signal.
This is the send-side half of email-click parity with push opens; the dashboard ingestion/aggregation/UI already exists.
Testing
tsc --noEmitclean forapps/notifications/src(pre-existing@types/babel__traversenode_modules errors are unrelated).🤖 Generated with Claude Code