Skip to content

Commit 08251e2

Browse files
lucasfcostaclaude
andcommitted
feat: add received_for to ReceivedEmail type
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f60251f commit 08251e2

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

resend/emails/_received_email.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ class _ReceivedEmailDefaultAttrs(_ReceivedEmailFromParam, BaseResponse):
152152
"""
153153
Reply-to addresses.
154154
"""
155+
received_for: List[str]
156+
"""
157+
Addresses the email was received for (forwarding recipients).
158+
"""
155159
message_id: str
156160
"""
157161
The message ID of the email.
@@ -182,6 +186,7 @@ class ReceivedEmail(_ReceivedEmailDefaultAttrs):
182186
bcc (Optional[List[str]]): Bcc recipients.
183187
cc (Optional[List[str]]): Cc recipients.
184188
reply_to (Optional[List[str]]): Reply-to addresses.
189+
received_for (List[str]): Addresses the email was received for (forwarding recipients).
185190
message_id (str): The message ID of the email.
186191
headers (NotRequired[Dict[str, str]]): Email headers.
187192
attachments (List[EmailAttachment]): List of attachments.

tests/receiving_async_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async def test_receiving_get_async(self) -> None:
2020
"to": ["recipient@example.com"],
2121
"subject": "Test subject",
2222
"created_at": "2024-01-01T00:00:00Z",
23+
"received_for": ["forwarded@example.com"],
2324
}
2425
)
2526

@@ -28,6 +29,7 @@ async def test_receiving_get_async(self) -> None:
2829
)
2930
assert email["id"] == "67d9bcdb-5a02-42d7-8da9-0d6feea18cff"
3031
assert email["object"] == "received_email"
32+
assert email["received_for"] == ["forwarded@example.com"]
3133

3234
async def test_should_get_receiving_async_raise_exception_when_no_content(
3335
self,

0 commit comments

Comments
 (0)