Repository navigation
feat(email): let the workflows email flag target each region - #123060
Conversation
Pass the instance region as a person property when evaluating transactional-emails-via-workflows, so release conditions can roll out US and EU separately. Both regions send to the US project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: e6cfbed2-6717-47d6-9d53-11a4b8b76372
|
😎 Merged successfully - details. |
🤖 CI report
|
|
Risk: No findings This PR passes the instance's cloud region (from CLOUD_DEPLOYMENT) as a Sentinel reviewed |
There was a problem hiding this comment.
Approved.
The security-sensitive email routing change has independent assurance from a current-head review and a STRONG-familiarity author. No unresolved substantive concerns or other refusal grounds were found.
- Author wrote 100% of the modified lines and has 40 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: no findings.
- posthog[bot] reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 10L, 1F substantive, 32L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1b-small (32L, 2F, single-area, feat) |
| stamphog 2.6.1 | .stamphog/policy.yml @ 9cfc529 · reviewed head 9cfc529 |
Problem
transactional-emails-via-workflows(feat(email): send transactional emails through workflows behind a flag #122019). Both the US and EU instances send to the US project, so the flag decides for both.emailandtransactional_email_template. A template's rollout % applies to US and EU recipients together, so EU can't stay off, or move on its own schedule, while US ramps.Changes
region(US,EUorDEV, fromCLOUD_DEPLOYMENT) as a person property. Instances with no region, such as self-hosted, pass nothing.region, so they match exactly as before. Addingregion = USto a condition keeps it US-only. Adding a separateregion = EUcondition rolls EU out separately.POSTHOG_TRANSACTIONAL_EMAIL_API_KEYis a US project key. That's a secret change. Until then, an EU send that the flag matches gets a 4xx from the US project, and the email falls back to Customer.io.How did you test this code?
Test rationale:
test_workflows_flag_sees_the_instance_regionfails if the flag stops receiving the instance region, or if an instance with no region passes aNonevalue that a condition could misread. The closest existing test,test_send_via_http_routes_through_workflows_when_flag_matches, runs with no region configured, so it covers only the case withoutregion.I'm an agent and couldn't run the Django test suite here (no Postgres or Docker), so CI runs the tests. I ran
ruff check,ruff format --checkandpy_compileon both files.Release status
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Opus 5.5 (
claude-opus-5-5)region.🤖 Generated with Claude Code
Created with PostHog Desktop