Skip to content

feat: Inbound#170

Merged
drish merged 6 commits intomainfrom
feat/inbound
Oct 26, 2025
Merged

feat: Inbound#170
drish merged 6 commits intomainfrom
feat/inbound

Conversation

@drish
Copy link
Collaborator

@drish drish commented Oct 20, 2025

  • Add resend.Emails.Receiving.get() and resend.Emails.Receiving.list()
  • Add resend.Attachments.Receiving.get() and resend.Attachments.Receiving.list()
  • Add type definitions: ReceivedEmail, ListReceivedEmail, ReceivedEmailAttachment,
    ReceivedEmailAttachmentDetails
  • Re-export EmailsReceiving and AttachmentsReceiving for mypy support

Summary by cubic

Adds inbound email receiving to the SDK with methods to fetch received emails and their attachments, plus typed responses. Supports pagination and exposes receiving namespaces under Emails and Attachments.

  • New Features

    • Get a received email: resend.Emails.Receiving.get(email_id)
    • List received emails with pagination: resend.Emails.Receiving.list(params?)
    • Get attachment details (with download URL): resend.Attachments.Receiving.get(email_id, attachment_id)
    • List attachments for a received email: resend.Attachments.Receiving.list(email_id, params?)
    • Added example: examples/receiving_email.py and tests for emails/attachments
  • Types

    • Added ReceivedEmail, ListReceivedEmail, ReceivedEmailAttachment, ReceivedEmailAttachmentDetails
    • Re-export EmailsReceiving and AttachmentsReceiving in resend for mypy support

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 10 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="tests/attachments_test.py">

<violation number="1" location="tests/attachments_test.py:68">
Rule violated: **No `should` in tests**

Rename this test to avoid using “should” in its name per the “No should in tests” guideline; use a direct, declarative description instead.</violation>
</file>

<file name="examples/receiving_email.py">

<violation number="1" location="examples/receiving_email.py:8">
Accessing RESEND_API_KEY via os.environ[...] raises KeyError when the variable is unset, so the intended EnvironmentError is never triggered. Use os.environ.get to avoid the KeyError.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@drish drish requested a review from bukinoshita October 24, 2025 02:06
Copy link
Contributor

@lucasfcosta lucasfcosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Seems like we have a few redundant comments but nothing blocking.

Comment on lines 27 to 33
print(f"HTML: {html_content[:100]}...") # Show first 100 chars
else:
print("HTML: None")

text_content = received_email.get("text")
if text_content:
print(f"Text: {text_content[:100]}...") # Show first 100 chars
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we cleanup the comments a bit?

"""


# Uses functional typed dict syntax here in order to support "from" reserved keyword
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Uses functional typed dict syntax here in order to support "from" reserved keyword

@drish drish merged commit ee59ece into main Oct 26, 2025
19 checks passed
@drish drish deleted the feat/inbound branch October 26, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants