feat(alerts): centralize email delivery - #71600
Merged
Merged
Conversation
MattPua
force-pushed
the
posthog-code/alerts-email-destination-product
branch
from
July 16, 2026 17:04
5bab427 to
34a6754
Compare
Generated-By: PostHog Code Task-Id: ec75816d-f0d0-439e-9c74-91a9ebf84493
MattPua
force-pushed
the
posthog-code/alerts-email-destination-product
branch
from
July 16, 2026 17:30
34a6754 to
0040a2d
Compare
MattPua
marked this pull request as ready for review
July 16, 2026 17:43
Contributor
|
Reviews (1): Last reviewed commit: "feat(alerts): centralize email delivery" | Re-trigger Greptile |
There was a problem hiding this comment.
Contained refactor that centralizes existing alert-email sending into a shared facade function with no behavior change; covered by new and updated tests, author is on the owning team, and Greptile's automated review raised no concerns.
- Author wrote 0% of the modified lines and has 13 merged PRs in these paths (familiarity MODERATE).
- 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 43L, 3F substantive, 103L/5F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (103L, 5F, two-areas, feat) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ 87f6ea1 · reviewed head 0040a2d |
Contributor
🤖 CI report |
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.
Problem
Insight alert emails are sent from the legacy alert task module instead of the shared alerts product. New alert products would need to duplicate the same email delivery setup.
Changes
How did you test this code?
bin/hogli test products/alerts/backend/test/test_email_notifications.pybin/hogli test posthog/tasks/alerts/test/test_alert_subscriptions.pybin/hogli ci:preflight --strict👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
No docs update. Existing email behavior is unchanged.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with PostHog Code using Codex CLI. Invoked
/sending-notifications,/writing-tests, and/improving-drf-endpoints. The native email HogFunction approach was discarded because it introduced a separate email concept instead of generalizing the existing insight alert email path.Created with PostHog Code