feat: add ReceivedFor to the received email type - #139
Merged
Conversation
The retrieve received email endpoint returns a received_for array, but ReceivedEmail did not decode it. The webhook type (EmailEventData) already had it. Documented at https://resend.com/docs/api-reference/emails/retrieve-received-email Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gabrielmfern
marked this pull request as ready for review
August 17, 2026 19:39
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds a nullable ReceivedFor field to the response DTO, mirroring the webhook model and JsonIgnore pattern. This is purely additive deserialization coverage with no behavior or contract changes.
Re-trigger cubic
Approval not submitted
This repository is configured to approve as @klotty, but that approval identity is unavailable.
Reconnect or verify the approval identity in repository settings.
cubic left this as a normal review comment instead of falling back to a Cubic App approval.
gabrielmfern
marked this pull request as draft
August 17, 2026 20:27
dielduarte
approved these changes
Aug 18, 2026
gabrielmfern
marked this pull request as ready for review
August 18, 2026 13:20
This was referenced Aug 18, 2026
This was referenced Aug 26, 2026
This was referenced Sep 4, 2026
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.
The retrieve received email endpoint returns a
received_forarray — "the recipient addresses the email was forwarded for, taken from theforclause of the message'sReceivedheaders" — butReceivedEmailhad no property for it, so the value was silently dropped on deserialization.EmailEventDatainResend.Webhooksalready hadReceivedFor, so this brings the API model in line with the webhook model. SameEmailAddressList?type andJsonIgnorepattern as the neighbouringCc/Bcc/ReplyToproperties.Two things worth noting:
No test is included because there is no existing test that deserializes
ReceivedEmailto extend, and a test asserting only that a new property round-trips would restate the attribute rather than cover behaviour. Happy to add one if you would rather have the coverage.ReceivedEmailbacks both retrieve and list, so the property appears on list results too, where it will be null. That matches howTextBody,HtmlBody, and the other retrieve-only fields already behave on this type. The list endpoint docs do not documentreceived_for.Related: the field is still missing from the OpenAPI spec, which is what DEV-1626 is about.
🤖 Generated with Claude Code
Summary by cubic
Expose forwarded-for recipients on retrieved emails.
Previously, the SDK dropped the retrieve endpoint’s received_for array during deserialization; now
ReceivedEmail.ReceivedForcaptures it, aligning the API model with the webhookEmailEventDataand docs.EmailAddressList?withJsonIgnore(WhenWritingNull), matchingCc/Bcc/ReplyTo.received_for.Written for commit 1076fa0. Summary will update on new commits.
Ref DEV-1626