feat(messages): add openedAt/clickedAt engagement fields to Message#11
Merged
Conversation
Adds the new read-only engagement timestamps returned by the messages API: - opened_at: first provider-reported email open (ISO 8601), or None. - clicked_at: first provider-reported link click (ISO 8601), or None. Both are set once on the first occurrence and hydrated on the Message model. README documents the two new subscribable webhook events, message.opened and message.clicked (the latter carries the clicked link).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Asserts the new engagement timestamps hydrate from the messages API and default to None when absent from the payload.
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.
Summary
SenderKit now records provider-reported email opens and link clicks on messages and emits matching outgoing webhook events. This brings the Python SDK up to date with those new read surfaces. Purely additive and backwards compatible.
SDK
Messagegains two fields, hydrated frommessages.get/messages.list(defaultNonewhen absent from the payload):opened_at— first provider-reported email open (ISO 8601 string), orNoneuntil opened.clicked_at— first provider-reported link click (ISO 8601 string), orNoneuntil a link is clicked.Both are set once on the first occurrence and are never updated afterward.
Webhooks
message.openedandmessage.clicked. These are engagement signals and never change a message's status (deliveredstays terminal); themessage.clickedpayload additionally carries the clickedlink.Related issues
Checklist
ruff check .passesruff format .appliedmypy srcpassespytestpasses (62 passed)The TypeScript and PHP SDKs receive the equivalent field additions in their own PRs.
🤖 Generated with Claude Code
Generated by Claude Code