Repository navigation
Docs: transactional email API page for code-managed templates, an anchor per error code #475
Description
Map: Map: send email from code with one PostHog call
Spec: Spec: code-managed email templates, sections "Docs page" and "Error catalog" (retargeted from the superseded #467)
Cast: Opus 5.5, high
Repository: PostHog/posthog.com
Question
Can an engineer or agent learn the whole code-managed template flow from one page, and does every docs_url the API returns open the fix for that error?
Delivers end to end. One beta page at /docs/workflows/transactional-email-api: what it is for, the project secret API key with hog_flow:write, the flag (in beta, enabled per project), the template format (Liquid, {{ variables.* }}, no person properties: sends carry variables only), sending from a file with posthog-node (the content hash flow, the rolling-deploy rule and the template_superseded warning, uploadTemplate for a rollback, how to ship the file with serverless bundles), upload by key, the send route /messaging/send/email/ by key and by id, the UUID route, "Managed by code" and the lock, adoption of an existing template, a cURL example, a plain statement that sends are not idempotent, and one anchored section per error code and warning in the spec's catalog, old and new. Every example sends from the reader's own domain. Its markdown twin serves the agent skill's shared docs. The copyable agent prompt and the llms.txt line stay out, as the map says.
Test seams. The site build. A link check that every code in the spec's catalog has an anchor on the page.
Write scope. A new page under contents/docs/workflows/ and its sidebar entry in PostHog/posthog.com.
Proof.
- Red: a
docs_urlfrom a local error response (template_not_found) opens a 404. - Green: it opens the matching section on the local site build.
- Local: screenshot of the page and of one error anchor in the PR.
Acceptance criteria
- Every catalog code has an anchor whose fix text matches the API message.
- The page says sends are not idempotent and carry variables only.
- The page says the feature is in beta and needs to be enabled for the project.
How to build (map #461)
/tddred-green-refactor, outside-in, at the seams named above. Real Postgres, Valkey and ClickHouse; mock only what the seam section allows.- Repo skills apply where the diff touches their area:
/writing-tests,/improving-drf-endpoints,/django-migrations,/adding-api-scopes,/implementing-mcp-tools,/writing-ui-components,/writing-kea-logics,/writing-user-facing-copy,/writing-code-comments. - Read code from
upstream/master(PostHog/posthog). The fork'smasteris stale. - Public repo: no usage numbers, customer names, internal metrics, Slack content or security reasoning in code, commits or the PR. Fixture addresses use
example.com. The private note the map points at is background only; never quote it. - Shipped means a draft PR handed off for review (see the map's Notes for remotes and branches). Never mark ready, enqueue or merge.
Activity
[-]Docs: email API reference page with an anchor per error code[/-][+]Docs: transactional email API page for code-managed templates, an anchor per error code[/+]Silthus commentedon Oct 17, 2026
Runtime: T3 child task
Task:
node:delegated-task:command%3Amcp%3A955e36b3-3986-469c-b816-09cf656780af%3Adelegate-task%3Awf-email-impl-475-2Cast: Opus 5.5, high. Cap 180 minutes.
Silthus commentedon Oct 17, 2026
Resolution
Shipped: draft PostHog/posthog.com#21306, branch
Silthus:docs/transactional-email-apiagainstmaster. Reviewed headc86c7a6a9894864505bb828b5df228a1523ff47b.fleet proof gatepasses on it (live-run evidence at HEAD, HEAD reviewed in final read 3).What shipped
contents/docs/workflows/transactional-email-api.mdx: one beta page at/docs/workflows/transactional-email-api.hog_flow:write, and the template format (Liquid,{{ variables.* }}, no person properties).posthog-node:templateFile,send, the content hash flow, rolling deploys andtemplate_superseded,uploadTemplatefor a rollback, serverless bundles (Next.js, Vercel, Netlify), and edge runtimes.if_not_supersededand thesupersededresult), the send route by key and by ID, the content hash algorithm with the spec's test vector, and the older ID route.template_supersededwarning, and everyposthog-nodecode.src/navs/index.js: Workflows › Transactional email › Send email from code, with a beta badge..md) at build time, so the skill can read it. No copyable agent prompt and no llms.txt line, as the map says.Proof
docs_urlfrom a realtemplate_not_foundresponse, opened on the local dev server, answered404(the Gatsby development 404 page). The anchor check found0/27.c86c7a6a9:200, and a plain navigation lands on the#template_not_foundsection. The anchor check finds27/27codes, each section quoting the server'sdetailandfixstrings verbatim from7845707ba33.key_in_usefix sentence made the check fail with26/27.G).~/.local/state/fleet/proof/PostHog/posthog.com/21306/c86c7a6a9894864505bb828b5df228a1523ff47b/live-run.What I ran: the docs dev server with
GATSBY_MINIMAL=true pnpm startthroughfleet heavy(pnpm, as the repo prescribes), not a full production build.Review
Opus 5.5, high effort, fresh read-only agents. Each round was recorded with
fleet proof review-startandreview-finish.Calls made
immutableis live now, with a read-only preview and Stop managing in code (Email templates: refuse edits to code-managed templates on the server #491, Email templates: read-only view of code-managed templates #492).why,fix, anddocs_url. The existing send-pipeline codes and the shared API codes have onlytype,code,detail, andattr, so the page gives their fix.invalid_requestalso covershashwithid, andkeysent with other fields on adoption.authentication_failedandpermission_deniedare two sections. A missing header answersnot_authenticated.template_supersededuses the server's wording. Inposthog-nodeit is{ code, message }, withoutfix.api_errorandunexpected_error.7845707ba33). The page documentsif_not_supersededandsupersededas landed, so nothing in the PR is marked pending.contents/and the nav. The script and its output are in the PR body and the proof storage.error.codefromposthog-nodehas a fix.enableLocalEvaluation: false, becausesecretKeyalso starts feature flag polling, which needsfeature_flag:read.posthog-nodealways calls@current.gh pr-assetsandgh --attachneed write access to PostHog repos, which this account lacks. They are published to the public fork withfleet proof publishinstead.Local setup (nothing in the diff)
PHANTOMJS_PLATFORM=linux PHANTOMJS_ARCH=x64, becausephantomjs-prebuilthas no arm64 build.DEBUGunset, because webpack inlinesprocess.env.DEBUGinto the SSR bundle.GIT_CONFIG_GLOBALfor the dev server only, because the globalurl.insteadOfrewrite breaks thegatsby-source-git"already cloned" check on a restart.Follow-ups
.mdoutput.posthog-nodeversion: the page names no version. Add one when Think through the Elements tab PostHog/posthog#5312 releases.configure-channelspage never mentions a default sender or Make default. This page now explains it. That page could too.