Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/with_inline_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
print("Sent email with local inline attachment")
print(local_email)

# Send email with remote inline attachment
# Send email with remote inline attachment using content_id
remote_attachment: resend.RemoteAttachment = {
"filename": "remote-resend-wordmark-black.png",
"path": "https://resend.com/static/brand/resend-wordmark-black.png",
"inline_content_id": "my-test-image",
"content_id": "my-test-image", # Using content_id as alternative to inline_content_id
}

remote_params: resend.Emails.SendParams = {
Expand Down
8 changes: 8 additions & 0 deletions resend/emails/_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class Attachment(TypedDict):
"""
inline_content_id: NotRequired[str]
"""
Alternative way to set the Content ID for inline attachments (same as content_id)
"""
content_id: NotRequired[str]
"""
Content ID for inline attachments used in HTML content with cid: references
"""

Expand All @@ -40,5 +44,9 @@ class RemoteAttachment(TypedDict):
"""
inline_content_id: NotRequired[str]
"""
Alternative way to set the Content ID for inline attachments (same as content_id)
"""
content_id: NotRequired[str]
"""
Content ID for inline attachments used in HTML content with cid: references
"""
2 changes: 1 addition & 1 deletion tests/emails_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_email_send_with_inline_attachment(self) -> None:
"filename": "image.png",
"content": [1, 2, 3, 4, 5],
"content_type": "image/png",
"inline_content_id": "my-image",
"content_id": "my-image",
}

params: resend.Emails.SendParams = {
Expand Down