Skip to content

Commit c9abc68

Browse files
authored
feat: Prefer content_id instead of inline_content_id (#154)
1 parent caa50d2 commit c9abc68

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

examples/with_inline_attachments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
print("Sent email with local inline attachment")
3232
print(local_email)
3333

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

4141
remote_params: resend.Emails.SendParams = {

resend/emails/_attachment.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ class Attachment(TypedDict):
2525
"""
2626
inline_content_id: NotRequired[str]
2727
"""
28+
Alternative way to set the Content ID for inline attachments (same as content_id)
29+
"""
30+
content_id: NotRequired[str]
31+
"""
2832
Content ID for inline attachments used in HTML content with cid: references
2933
"""
3034

@@ -40,5 +44,9 @@ class RemoteAttachment(TypedDict):
4044
"""
4145
inline_content_id: NotRequired[str]
4246
"""
47+
Alternative way to set the Content ID for inline attachments (same as content_id)
48+
"""
49+
content_id: NotRequired[str]
50+
"""
4351
Content ID for inline attachments used in HTML content with cid: references
4452
"""

tests/emails_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_email_send_with_inline_attachment(self) -> None:
144144
"filename": "image.png",
145145
"content": [1, 2, 3, 4, 5],
146146
"content_type": "image/png",
147-
"inline_content_id": "my-image",
147+
"content_id": "my-image",
148148
}
149149

150150
params: resend.Emails.SendParams = {

0 commit comments

Comments
 (0)