Skip to content

feat(skills): move Mailjet sends to PostHog - #466

Draft
Silthus wants to merge 661 commits into
mainfrom
feat/migrate-email-mailjet
Draft

Silthus wants to merge 661 commits into
mainfrom
feat/migrate-email-mailjet

Conversation

@Silthus

@Silthus Silthus commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Parked until after 2026-11-25. Michael chose SendGrid as the first migrate-email provider on 2026-11-14; this PR stays a draft and resumes after that date, with the slim pass from research/2026-11-14-review-bloat-retro before its next review round.

Problem

A person who sends with Mailjet and asks to move those sends to PostHog gets no help: migrate-email has no Mailjet variant.

With this PR, migrate-email-mailjet moves Mailjet sends to PostHog's email send in each language where both Mailjet and PostHog have an SDK, and wizard migrate mailjet runs it.

Note

#472, the core migrate-email skill, merged to main, and this PR now targets main. It adds one provider folder, one config variant, one AGENTS.md row and the provider in the bundle test; the shared steps it uses are on main. The other provider PRs land in any order: the lists they all touch, config.yaml, AGENTS.md and the skill test, conflict in one line each as they land.
Nothing merges until code sends are live and usable for customers: Michael's rule for #451 and every PR stacked on it.

Impact

Sends that arrive with migratedFrom: 'mailjet' show whether people use this skill to move off Mailjet. Read it 14 days after the Wizard runs migrate as a family.

Merge risk

Caution

🔴 Merge risk: high · two-way door until the next context-mill release ships the skill; one-way once agents run it, because a migration's changes persist in each app's code and PostHog account (senders, imported suppressions, keys, deleted provider templates)

  • At merge into main nobody changes yet: the skill ships with the next context-mill release, and a person who picks wizard migrate mailjet gets an agent that rewrites their Mailjet sends to PostHog's SDK, where before the command had no Mailjet variant.
  • A wrong instruction in the skill silently changes how an agent rewrites someone's sends: once the person deploys the rewrite, an email stops sending, a refusal is swallowed or newly raised, or opens are tracked that Mailjet didn't track, without an error. Every case these files can't check keeps the site on Mailjet with a reason, and the person reviews the diff and runs Step 8's checks before committing.
  • The suppression import, in a migration or on its own when the person asks only to re-import Mailjet's list, adds addresses to the person's PostHog suppression list. Uncovered: a wrong read of Mailjet's hard bounces and spam reports would silently block valid recipients, or leave out addresses Mailjet blocked so PostHog sends to them again. A repeat import keeps every entry, so a wrong one stays until someone removes it.
  • Uncovered: the live run and prod-shape (gaps). No run applies these rules on a real app yet, and there is no store of real customer codebases to sample.
  • The shadow diff shows only the new migrate-email-mailjet bundle and its manifest.json and skill-menu.json entries change; every other bundle, migrate-email-resend included, is byte-identical.
  • Switch-off: none. A revert only stops new runs; a migration an agent already ran stays in that app's code and PostHog account.
  • Tier: critical: a wrong rule silently changes how an agent rewrites an app's email sends, so an agent decides only review and status alone.

Rollout

Summary

references/mailjet/ holds the three files each variant has:

  • sdk-reference.md: Mailjet's official libraries in Node.js, Python, Ruby, PHP, Go, .NET and Java, the v3.1 and v3 Send APIs over HTTP, SMTP, and framework mailers. It covers how each library reports errors, including mailjet-rest's 401 error at 1.7.0, its typed errors and retries from 1.8.0, the switches that turn a request off (Node's .request third argument and 3.x perform_api_call, PHP call, Ruby perform_api_call, Python dry_run), the host setting that marks an account on Mailjet's US setup, stored templates and Mailjet's template language, status reads, the Event API webhooks, and the APIs that are not sends.
  • mapping.md:
    • Fields. Each v3.1 field, with its v3 name, maps to PostHog's or names what keeps a site on Mailjet: Sender, Headers, CustomID, EventPayload, CustomCampaign, DeduplicateCampaign, MonitoringCategory, Priority, URLTags, anon open tracking, a ReplyTo with a name, SandboxMode or a client switch that is on or set at run time, and sends with several messages or recipients. Sites with Cc, Bcc, Attachments or InlinedAttachments stay too, because no PostHog SDK takes them yet.
    • Tracking. TrackOpens and TrackClicks are read per send, capped by the account's Enabled, Disabled or Anonymous setting, asked once per account with whether any contact refused open tracking. Tracking never maps to captureEngagement: PostHog adds its open pixel to every email, and counts clicks only for a PostHog template not marked sensitive. Opens untracked (account Disabled or TrackOpens: disabled) go to Step 3's "Opens the provider didn't track": the person's yes moves them with open pixel added: the person agreed, otherwise they stay (open tracking off). Anonymous opens (anonymous open tracking), or a contact who refused open tracking keep the site. Unknown answers keep it too (open tracking not checked): unknown contact open consent keeps every site of the account, and an unknown open setting every site that doesn't set TrackOpens: disabled. Opens tracked moves, and the plan row notes that PostHog counts no clicks for any moved site whose clicks Mailjet tracked. A site that moves to a PostHog template not marked sensitive also needs Mailjet's clicks tracked and no contact refusing click tracking, or the person marks the template sensitive.
    • Calls. SMTP through in-v3.mailjet.com stays, since PostHog has no SMTP relay; Go's SendMailSMTP, framework mailers including an app's own Rails delivery method, and campaign draft sends stay.
    • Templates. A TemplateID send, and a send with TemplateLanguage: true and its own content, move by rendering Mailjet's template language in the code (template-to-code.md): values and defaults, nested values, conditions, loops, operators, {% set %}, the named functions, the mj:contact and mj:sender values, and the template's headers. A tag Mailjet fills from the account, data:, segment: and other mj: reads, an unnamed function, another header, a test of a value alone that can be 0, "" or empty, and a value without a default that the send can leave out keep it on Mailjet: since October 2025 Mailjet renders such a value as empty when the template's schema declares it, and blocks the email when it doesn't. A template made in PostHog, in Liquid, is used only when the person asks for one.
    • Errors. Never widen a catch. Each language's form becomes PostHog's error: Node.js, Ruby and mailjet-rest 1.8.0+ threw, each catch mapping to the same kind of PostHog error (a catch of ApiRateLimitError, which 1.8.0+ never raised past its own retries, keeps the site); Python before 1.8.0, PHP and .NET PostAsync answered a status, so the status check becomes a catch that raises network_error again, and a Guzzle catch around PHP's call is mapped by what reached it; Go keeps if err != nil, with APIFeedbackErrorsV31 read as validation_error or 403; .NET SendTransactionalEmailAsync moves only when the old code ended an invalid send answered in Messages and a MailjetServerException with HttpCode 400 the same way; Mailjet answered the two apart and PostHog throws validation_error for both, so many such sites, such as one that logs Status "error" with no catch, stay with can't tell Mailjet's invalid-send paths apart. On the v3.1 Send API, Ruby's gem answered an invalid recipient address without raising and raised Mailjet::BadRequest for every other 400, so a Ruby site moves under the same rule. A 400 or a message with Status: 'error' reads validation_error, never a status. Raw HTTP follows its client, and a status option that stops the throw for some failed statuses only, such as axios's validateStatus: s => s < 500, keeps the site; a Guzzle 7 RequestException catch, or a ConnectException-only one, takes one kind of network failure and keeps the site. A site that read no result logs PostHog's error and goes on, apart from a .NET SendTransactionalEmailAsync site, which moves only on the rule above. An unknown mailjet-rest version, or a range across 1.7.0 or 1.8.0, keeps the Python sites; 1.7.x's 401 keeps raising. PostHog's error carries the retry delay its answer named and no headers: a read of a Retry-After header becomes a read of PostHog's retry delay, converted to the rewrite file's unit, and the Node.js wrapper carries retryAfterMs; a site that reads any other header of Mailjet's answer stays, reads <header> from Mailjet's answer.
    • Webhooks. Each Event API event maps to a $workflows_email_* event, and a click maps to $workflows_email_link_clicked only for a PostHog template not marked sensitive: a code send counts no clicks, and a site whose clicks feed a handler moves only to such a template. A handler that matches events by MessageID, CustomID or Payload, or acts on blocked or unsub, which have no PostHog event, keeps its sites on Mailjet.
  • account.md: Mailjet's DKIM, SPF and ownership records next to PostHog's, and the app's own key pair for templates and suppressions, since Mailjet has no read-only key and a new key can't read another key's templates. It reads the account's tracking settings and contact opt-outs, and hard bounces and spam reports from the message and contact APIs (MessageStatus 10 and 6); soft bounces, the campaign exclusion list and list unsubscribes are left out, with the reason why. Every request goes to api.us.mailjet.com for an account on Mailjet's US setup. Each suppression entry is imported with PostHog's reason: hard bounces as bounce, which wins when an address is also a spam report, spam reports as complaint, and blocked addresses of unknown cause as manual. For Step 3's suppression-list question it asks only about addresses someone had Mailjet block, since the import blocks hard bounces in PostHog too.
  • Text part, after feat(migrate-email): move Resend sends in every PostHog SDK's language #472's final steps: a template with an empty Text-part stays (turns the plain-text part off) unless its IsTextPartGenerationEnabled setting shows Mailjet generated a text version. Mailjet's docs don't say whether the Send API makes a text part for an HTMLPart with no text, so such a site, or one whose TextPart is built at run time and can be empty, moves only when an email it sent with no text shows a text/plain part, checked once per Mailjet account and Send API version. A moved site keeps sending a run-time TextPart as text, left out only when empty.

The mapping names PostHog's fields, client and errors through the rewrite file for the site's language, from #472: one references/rewrite-<language>.md per PostHog SDK, and Step 7's single list of what every SDK's send takes.

Evidence

  • Lane gate on f36e3ed: vitest run scripts passes 344 tests in 30 files, including the core's check that every Step N says under pointer in the Mailjet bundle names a real section, and node scripts/build.js builds clean with no stray files. The shared provider test in migrate-email-skill.test.js publishes Mailjet as the wizard migrate mailjet subcommand; the shadow diff below shows the bundle's contents.
  • Shadow diff from main at 8cd7381, after feat(migrate-email): move Resend sends in every PostHog SDK's language #472 merged, to f36e3ed: only the new migrate-email-mailjet bundle, manifest.json and skill-menu.json change, and the Mailjet bundle's shared step, rewrite and template-to-code.md files are byte-identical to the Resend bundle's; every other bundle is byte-identical. Saved in proof storage.
  • SDK source: some error, timeout and version rules rest on Mailjet SDK source read through raw.githubusercontent.com after Fleet refused the mailjet org, plus one npm read. The Mailjet attachments follow-up rechecks them against dev.mailjet.com.
  • CI: build passes on f36e3ed, with CodeQL, Semgrep and the Wiz scanners.
  • Prod shape (owed): gap. The inputs are customer-written send code and config and each person's Mailjet account content; there is no store of real customer codebases to sample. Michael's planned trial on generated codebases covers it after the SDKs land.
  • Mailjet facts checked against the sources for this round's fixes: the Templating Language article's October 2025 update (declared values render empty, undefined ones block), the tracking consent article (account Enabled/Disabled/Anonymous, contact mjoptinopen and mjoptinclick), and the SDK sources (mailjet-rest v1.6.0, v1.7.0, v1.8.0 and v1.9.1 errors and retries, PHP v1.6.5 call and Request::call's Guzzle catches, Guzzle 7's exception classes, node-mailjet 3.x perform_api_call, Ruby perform_api_call, Python dry_run from 1.7.0, the .NET client's SendTransactionalEmailAsync), and PostHog's Python SDK retries. For the final pass, the Mailjet clients' timeout and retry options: node-mailjet's client options (timeout, and maxRetries in newer versions), mailjet-rest timeout on create and on Client from 1.7.0 with its 60 s default, PHP v1.6.5 setTimeout and setConnectionTimeout, the Go client's SetClient and WithContext, the .NET client's HttpClient constructor, and the Ruby gem's connection.
  • Live run (owed): gap. An agent run of this migration on a real app needs the released email SDKs and the production send API; Michael's planned trial on generated codebases runs it after both land. The dry runs on fixture apps at older heads (the last at f85d254) predate the move of templates into the code and this round's rules, so they are not evidence for this head. No run at this head moves a template site, a tracking-capped site, or a mailjet-rest 1.8.0+ site.

Decisions

Question Answer Who Where
When this merges Not before code sends are live and usable for customers, for #451 and every PR on it 👤 Human this PR
Who lands the provider PRs We land them ourselves, with every ReviewHog finding addressed and the full QA swarm run 👤 Human this PR
Which providers Mailgun, Loops, SendGrid, Postmark and SMTP, plus the providers the Wizard detects that a real codebase sends transactional email from 👤 Human Silthus/posthog#461
Mailjet tracking A field the send leaves to the account takes the account's setting. Tracking never maps to captureEngagement: opens untracked moves only with the person's yes to PostHog's open pixel (the core's "Opens the provider didn't track", Michael's later decision), unknown contact consent keeps every site, an unknown open setting every site that doesn't set TrackOpens: disabled, opens tracked moves with a no-clicks note. Replaced moving with captureEngagement: false 👤 Michael this PR
Clicks on a PostHog template A template not marked sensitive counts clicks, so it needs Mailjet's clicks tracked and no contact's click opt-out; otherwise the person marks it sensitive or the site stays 🤖 Agent this PR
A node-mailjet or axios timeout Keeps the site on Mailjet: node-mailjet hands its timeout to axios, whose limit the SDK can't keep, as Step 7 says; a 3.x timeout in connect or .post's options stays too, and so does Faraday's timeout on an adapter other than net_http 🤖 Agent this PR
Stack shape One PR per provider, each on #472 🤖 Agent #472
Which key reads templates and suppressions The app's own key pair: Mailjet has no read-only key, and a new key can't read templates or messages another key made, so the run creates none 🤖 Agent this PR
Which suppressions move Hard bounces and spam reports. Soft bounces are temporary, the campaign exclusion list blocks campaigns only, and list unsubscribes are marketing preferences 🤖 Agent this PR
Mailjet's bounce status codes 10 is a hard bounce and 9 a soft one, as Mailjet's message API reference lists them 🤖 Agent this PR
A send with CustomID, EventPayload or CustomCampaign Stays on Mailjet: no PostHog SDK takes tags yet 🤖 Agent this PR
A .NET SendTransactionalEmailAsync invalid send Mailjet returned one with Messages and threw MailjetServerException for one without, even on a 400; PostHog throws validation_error for both, so the site moves only when the old code ended both the same way, and otherwise stays 🤖 Agent this PR
A Ruby invalid recipient address, or a partial status option A Ruby send is v3.1 only when its version option or the gem's api_version says so, since the gem defaults to v3, and a send whose version is still unknown after reading the config or asking the person stays. On the v3.1 Send API, the gem returned an invalid address and raised Mailjet::BadRequest for other 400s; the site moves only when both ended the same way. A raw client whose status option stops the throw for some failed statuses only, such as axios's validateStatus: s => s < 500, stays, since PostHog's status codes don't match Mailjet's one to one 🤖 Agent this PR
Grouped or mixed template conditions A condition with one test, or that joins its tests with only and or only or, drops the parentheses that hold whole tests or one value, such as (var:count) > 0, and keeps those in a quoted string. One that mixes and with or, or compares a test or a group of tests with a value, keeps the template on Mailjet: PostHog's Liquid refuses parentheses and reads and and or from the right 🤖 Agent this PR
Merge-risk tier critical: context-mill keeps no critical-path list, but a wrong rule silently changes an app's email sends, so agents decide only review rounds and status here, and Michael decides gaps 🤖 Agent this PR
A narrow catch on one Mailjet error Becomes a catch of PostHog's error that checks the same kind and raises the rest, never wider; a catch of one kind of network error stays 🤖 Agent this PR
A template value the send can leave out Keeps the template on Mailjet unless TemplateErrorDeliver is on: since October 2025 Mailjet sends declared values as empty and blocks undefined ones, and these files can't read the schema. Replaced blocking the send in the code 🤖 Agent this PR
Account Anonymous tracking and contact opt-outs Cap the send's own TrackOpens; anonymous opens or any contact who refused open tracking keep the site, untracked opens too, even with the person's yes to the pixel 🤖 Agent this PR
mailjet-rest versions 1.8.0+ raises typed errors after retrying 429 and 5xx, so its sites keep raising, an ApiRateLimitError catch stays, and the send keeps PostHog's own retries, with a plan note that Mailjet's client retried a 500, 502 or 504; 1.7.x raises on a 401; only a lockfile or exact pin names the version, and an unknown one keeps the Python sites 🤖 Agent this PR
A client that makes no request Node's .request third argument and 3.x perform_api_call on a call that keeps it, a PHP post that makes no call, Ruby perform_api_call, Python dry_run and .NET isSandboxMode keep the site, like SandboxMode 🤖 Agent this PR
A send that read no result, or a raw HTTP client Follows what the old call did: a client that threw keeps failing on every error, and one that answered a status logs PostHog's error and goes on, raising network_error where the old code let a network failure through 🤖 Agent this PR
A Ruby site that rescued nothing Checks the address before the send and skips an invalid one, as the gem went on only for that; every other error raises 🤖 Agent this PR
A template default that can get false in a PostHog template Keeps the template on Mailjet, since Liquid's default replaces false and Mailjet's doesn't 🤖 Agent this PR
An account on Mailjet's US setup Spotted by api.us.mailjet.com in a URL or in the client's host setting, and every account request uses that host 🤖 Agent this PR
cc, bcc and attachments Stay on Mailjet in every language, since no PostHog SDK takes them yet (#472) 🤖 Agent this PR
An address in both the hard bounces and the spam reports Imported once as bounce, the one reason that blocks a moved send 🤖 Agent this PR
An HTMLPart with no text part Moves only when an email the site sent with no text shows a text/plain part, checked per Mailjet account and Send API version, since Mailjet's docs don't say whether it makes one; otherwise turns the plain-text part off 🤖 Agent this PR
Headers of Mailjet's answer A Retry-After read moves to PostHog's retry delay; a read of any other header keeps the site, since PostHog's answer carries no headers (ReviewHog on bacb274) 🤖 Agent this PR
Proof kinds Shadow diff of the built bundles at the head, against main: only the Mailjet bundle and its menu entries change. Live run and prod-shape, recorded as gaps until the SDK releases 🤖 Agent this PR
A test pinned to the mapping's wording Removed: the shared provider tests build and check the bundle, and the render-or-block behaviour is the live run's to show 🤖 Agent this PR

Involvement: qa-swarm round 1 at 78a678a (fresh-eyes, correctness, risk, design, anti-overengineering, sweep, and the team lenses review-hog-perspective-michael and review-hog-perspective-analytics-instrumentation), round 2 on the fixes at 480e44e, final reads from 7f6f215, and PostHog Review at 47b2bcb (three findings, fixed in 04c01b1 and 6095e4a) 6095e4a (one finding, fixed in 21f4681 and 411373e), and 21f4681 (one finding, fixed in 411373e and 13c8078); earlier rounds on older heads. Final pass after the core finished: forward merge of 8ead8e1 in 38b22d9 (no conflicts), convergence with the core's deadline, click, sensitive-template and report rules in ed36b9e, and two-family final reads on it, with fixes in 4c65f72, 6fdde89 and 16ce22f, the last read clean. PostHog Review at 16ce22f (three findings: two fixed in ecc3ee1, the .NET one in e7aa12b). Second core merge of 7ccc0ee in e232970 (no conflicts), reconciled with Step 7's network-failure and connect-limit rules in e7aa12b, with final reads fixed in 3c6d4bd, 058fa74, 97989d5, ead2406, d7a0fe0, b1b6856 and 94c5c0c. Third core merge of f658354 in fdfeff9 (no conflicts), reconciled with Step 7's library-default and axios timeout rules and Step 3's untracked-click rule in 969f0e2, with final reads fixed in 77842d3 and 52776c0. Fourth core merge of 17c6ca1 in de6c6db (no conflicts), reconciled with Step 3's "Opens the provider didn't track" and the webhook rule for events with no PostHog event in d322359, with a final read fixed in a06f654. The quality judge on a06f654 found that a .NET SendTransactionalEmailAsync 400 without Messages threw where one with Messages returned; fixed in ba8bd63, checked against MailjetClient.SendTransactionalEmailsAsync. Fifth core merge of 090ac92 in 298746b (no conflicts; its recurring re-import, project-get and test changes needed no Mailjet edit), final read 29 answered in the description. ReviewHog on 298746b (two should-fix findings, the Ruby invalid-send paths and a partial axios validateStatus), fixed in e109767, with final reads fixed in 0106713, f71d5af, ab583f1 and f4592ca, then ReviewHog on f4592ca (one should-fix finding, grouped template conditions), fixed in f23a81c, with final reads 35 to 38 fixed in 9d574eb, 6b42b8d, f15314a and f9f65f4, and final read 39's one nit fixed in this description. ReviewHog on f9f65f4: no findings. Main merge after #472 landed: f33a2c5 merges #472's final head 418cc5a and 49e5f09 merges main 8cd7381 (one add/add conflict in the shared skill test, where main's blob equals #472's, kept as the branch has it; the merge changes nothing), adapted to #472's final shared steps in 3e31918 (suppression reason, Step 3's question, the empty text part, the click row), with final reads 40 to 42 fixed in 822e35c, bf64763 and bacb274, and final read 43's description finding fixed in this description. Gate on bacb274 passed; ReviewHog on bacb274 (one should-fix finding, the retry delay #472 added), fixed in af12ccf, with final read 44's pointer nit fixed in f36e3ed and its description finding fixed here. Final read 45 on f36e3ed: no findings; gate on f36e3ed passed; ReviewHog on f36e3ed: no findings. Proof: lane gate, shadow diff against main and CI at this head; the live run and prod-shape are gaps.

🤖 Agent context

Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5, high), as the migration-skills slice of Silthus/posthog#461. Reviews on GPT-6.1 Sol (high), the fresh-eyes lens on Opus 5.5; fixes on Opus 5.5 (high).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

Silthus and others added 28 commits November 5, 2026 09:42
Brings #472's Step 7 rule: behind a reverse proxy, email gets its own client on PostHog's host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's Step 7 rule: behind a reverse proxy, email gets its own client on PostHog's host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's Step 7 rule: behind a reverse proxy, email gets its own client on PostHog's host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's Step 7 rule: behind a reverse proxy, email gets its own client on PostHog's host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's Step 7 rule: behind a reverse proxy, email gets its own client on PostHog's host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's Step 7 rule: behind a reverse proxy, email gets its own client on PostHog's host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The step 7 proxy test matched only the separate-client wording, so
dropping "leave the secret key off the app's existing client" still
passed. Assert that clause too; it fails without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… key) into feat/migrate-email-sendgrid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #472's added assertion in the Step 7 proxy test. No skill text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A send of a template stored at the provider now moves by bringing the
email into the code: its HTML and text become a file next to the send,
the code renders the variables with the provider's escaping, and the
site sends the code form. A template made in PostHog, sent by its ID,
is used only when the person asks for one.

- template-to-code.md: the check, where the email goes, how each
  language renders it without a new dependency, and the escaping rule.
- Steps 3, 7 and 9: the new default, the template form on request, and
  the report items for emails brought into the code.
- SendGrid: Handlebars in the code, including the helpers the template
  form couldn't take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A send with its own content and legacy substitutions stayed on SendGrid
only because SendGrid put the values in. The code now does the same
replace before the send, under the escaping rule of template-to-code.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 10 commits November 13, 2026 15:02
…pty Text as left out

Step 3 reads only the Check part of the template file, so the rule that
keeps a template whose provider sent no text part moves there. Resend's
Go SDK leaves an empty Text out of the request, so Resend made that text
part from the HTML, and such a site moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ain text off

A dashboard copy shows no plain text both for a template without one and
for one whose plain text is an empty string. Ask which, or read the
template from the API; when nobody can tell, the site stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion and keep the answer

A dashboard copy has no key to read the template from the API, so the
question offers to make one. The answer goes into the template's plan
note, so a copy made again in Step 7 asks nothing new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nly in Step 3

The template's note records its plain text however the template was
read, so Step 7 never asks again, and the key is offered only in Step 3,
before Step 5 asks the person to delete it. A site stays whenever
neither the answer nor the API read settles it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PostHog's bulk add takes only bounce, complaint or manual, and writes its own
reason text, such as "Imported (bounced)". The removal guard now keys on that
prefix, and the import maps each Resend origin to the reason value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…them

PostHog's list records no source an app could check before a removal, a bulk
add skips an address removed earlier, and an app can't call the import tool.
PostHog blocks a transactional send only to an address that hard-bounced, and
records that itself. So each such call becomes a "Before cutover" item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PostHog blocks a transactional send only to an address that hard-bounced, so
the weekly re-import limits mail to bounced addresses, not complaints. A call
that removes an address becomes an "After cutover" item the person acts on
when a moved send fails with recipient_suppressed. A call that adds one names
the action before the deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-import only now names bounces alone, and an app call that adds an address
also records it where the moved sends can skip it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A moved send reaches every address an app's add call put on the provider's
list, and an app-side flag misses past adds and survives a reactivation. So
Step 3 asks once which sites rely on the call, and keeps them on the provider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 3 asks which sites rely on the provider's list for addresses added by
hand or by the app, and a non-answer keeps every site when the app adds
addresses itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 6 commits November 13, 2026 15:52
…the list

The suppression-list question gets its own Step 3 section, asks only about
sites that would move otherwise, keeps them on a non-answer, and says what
would let them move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e work

The question now comes right after the field checks, so a site it keeps
needs no template copy or PostHog template, and the plan note carries what
would let the site move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
posthog-rs's async email send waits between retries with tokio::time::sleep
and sends through reqwest, so a site on async-std or smol stays on Resend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main equals #451's merged head a090b5b, which this branch already contains, so the tree is unchanged from f98eb3b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus changed the base branch from feat/migrate-email-all-sdks to main November 13, 2026 16:26
Silthus and others added 6 commits November 13, 2026 16:27
…main

Map each suppression entry to PostHog's `reason` (`bounce`, `complaint`
or `manual`) as Step 5 now takes it, drop the "which entries count" text
Step 5 no longer reads, and name the addresses Mailjet blocks for Step
3's suppression-list question. A template with an empty text part now
stays unless Mailjet generated a text version, read from the template's
`IsTextPartGenerationEnabled`, and the click row follows Step 7's rule
on template keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… question, and check an HTML-only send's text part

An address in both the hard bounces and the spam reports now imports as
`bounce`, the one reason that blocks a moved send. Step 3's question asks
only about addresses someone had Mailjet block, since the import already
blocks hard bounces in PostHog. A send with `HTMLPart` and no text part
moves only when one of its emails shows a `text/plain` part, since
Mailjet's docs don't say whether it made one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…count and version, and at run time

A `TextPart` the code builds at run time that can be empty now counts
like a missing one, and the person checks one email for each Mailjet
account and Send API version the HTML-only sites use, each answer
deciding only those sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… email it sent without text

A site whose `TextPart` the code builds at run time keeps sending it as
`text` when it moves, left out only when empty, and the person checks an
email the site sent with no text, since one with the code's own text
can't show whether Mailjet made a text part.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed bacb274: 1 Should fix.

This is review round 7 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

Silthus and others added 2 commits November 13, 2026 17:05
… that read other answer headers

The Node.js error wrapper now carries PostHog's `retryAfterMs`, a read of
a `Retry-After` header becomes a read of PostHog's retry delay in the
rewrite file's unit, and a site that reads any other header of Mailjet's
answer stays, since PostHog's answer carries no headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… delay"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed f36e3ed: no findings.

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