Repository navigation
Conversation
emails.send now posts template_id and distinct_id at the top level of the request body, for the sync and async clients. The server accepts both shapes, so this changes only the wire format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: e72a2c10-f145-4f7c-8754-a4fcc06a18be
Contributor
posthog-python Compliance ReportDate: 2026-10-30T12:35:46.415703+00:00 ✅ All Tests Passed!121/121 tests passed Capture_V1 Tests✅ 95/95 tests passed View Details
Capture_Ai Tests✅ 5/5 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
Feature_Flags_Local_Evaluation Tests✅ 4/4 tests passed View Details
|
This branch has not been deployed
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.
💡 Motivation and Context
The transactional email send API now takes
template_idanddistinct_idat the top level of the body (PostHog/posthog#126287), the same namesemails.sendtakes. The nestedtemplate.id/identifiers.distinct_idshape stays accepted for 7.81.0, but new versions should send the documented shape.emails.send(sync and async) posts{"template_id", "to", "message_data", "distinct_id"}.distinct_idis still only sent when the caller passes one.EmailError, retries and the URL stay the same..sampo/changesets/.Note
Merge after PostHog/posthog#126287 is deployed, so a release never sends the flat body to a server that doesn't read it yet.
💚 How did you test it?
uv run pytest posthog/test/test_emails.pypasses, with the body assertions updated for the flat shape.ruff format --check,ruff checkandmake public_api_checkpass. The public API snapshot doesn't change.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
_prepare_send, which both the sync and async clients use.message_datakeeps its name, because the server's per-template route and this SDK already use it.🤖 Generated with Claude Code
Created with PostHog Desktop