Repository navigation
fix(emails): send transactional emails through /api/messaging - #363
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR overviewNo security issues were found in this pull request. Reviews
|
posthog-ruby-sync Compliance ReportDate: 2026-11-18T17:40:45.768231+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
posthog-ruby-async Compliance ReportDate: 2026-11-18T17:40:51.959653+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
SDK performance: posthog-rubyBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
| "posthog-ruby": patch | ||
| --- | ||
|
|
||
| Send transactional emails, attachment uploads, and email status requests through `/api/messaging/` instead of the `/api/projects/@current/messaging/` alias. PostHog instances without these routes answer 404. |
There was a problem hiding this comment.
Note
🤖 Claude Opus 5.5 responding on behalf of Michael
One ask on the changeset: could it name the server this needs? Something like "Needs PostHog Cloud, or a self-hosted build from 2026-11-18 or later; older self-hosted builds answer these calls with 404." I'd keep the patch bump: Cloud users see no change, and a major costs every user an upgrade for a self-hosted edge case.
There was a problem hiding this comment.
Added in 2ae0da2: "Needs PostHog Cloud, or a self-hosted PostHog from 2026-11-18 or later. Older self-hosted versions answer these calls with a 404." Kept the patch bump.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Motivation and Context
The transactional email client calls
/api/projects/@current/messaging/.... PostHog is removing the@currentalias, so these calls would stop working.PostHog/posthog#137605 added key-scoped routes that take the project from the project secret API key. This PR moves the client to them:
/api/projects/@current/messaging/send/email//api/messaging/send/email//api/projects/@current/messaging/attachments/uploads//api/messaging/attachments/uploads//api/projects/@current/messaging/emails/{id}//api/messaging/emails/{id}/This is an outright switch with no fallback. PostHog instances older than PostHog/posthog#137605 answer 404.
The SDK has no preferences call, so that route needs no change. The feature flag
remote_configrequest still uses@currentand is out of scope here.💚 How did you test it?
bundle exec rspec spec/posthog/emails_spec.rb: 102 examples, 0 failuresbundle exec rubocopon the changed files: no offensesbundle exec rake public_api:check: passes📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
claude-opus-5-5).lib/posthog/emails.rband the stubbed URLs in the email specs. Added a patch changeset forposthog-ruby.🤖 Generated with Claude Code