Skip to content
Merged
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
18 changes: 9 additions & 9 deletions examples/helpers/mail_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def build_attachment1():
"""Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content.
Another example: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/attachment.md"""
attachment = Attachment()
attachment.content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl"
attachment.file_content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl"
"Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12")
attachment.type = "application/pdf"
attachment.filename = "balance_001.pdf"
attachment.file_type = "application/pdf"
attachment.file_name = "balance_001.pdf"
attachment.disposition = "attachment"
attachment.content_id = "Balance Sheet"
return attachment
Expand All @@ -95,9 +95,9 @@ def build_attachment1():
def build_attachment2():
"""Build attachment mock."""
attachment = Attachment()
attachment.content = "BwdW"
attachment.type = "image/png"
attachment.filename = "banner.png"
attachment.file_content = "BwdW"
attachment.file_type = "image/png"
attachment.file_name = "banner.png"
attachment.disposition = "inline"
attachment.content_id = "Banner"
return attachment
Expand Down Expand Up @@ -227,19 +227,19 @@ def build_kitchen_sink():
]

message.attachment = Attachment(FileContent('base64 encoded content 1'),
FileType('application/pdf'),
FileName('balance_001.pdf'),
FileType('application/pdf'),
Disposition('attachment'),
ContentId('Content ID 1'))
message.attachment = [
Attachment(FileContent('base64 encoded content 2'),
FileType('image/png'),
FileName('banner.png'),
FileType('image/png'),
Disposition('inline'),
ContentId('Content ID 2')),
Attachment(FileContent('base64 encoded content 3'),
FileType('image/png'),
FileName('banner2.png'),
FileType('image/png'),
Disposition('inline'),
ContentId('Content ID 3'))
]
Expand Down