Skip to content

Commit

Permalink
docs: correct attachment example (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arbitrage0 authored Sep 10, 2020
1 parent 9392eab commit 6606e8d
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit 6606e8d

Please sign in to comment.