Skip to content

Commit 4d2cc1d

Browse files
author
elbuo8
committed
Added CID support
1 parent a898345 commit 4d2cc1d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

README.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ Set File Attachments
130130
message.add_attachment_stream('filename', 'somerandomcontentyouwant')
131131
# strings, unicode, or BytesIO streams
132132
133+
Set Content ID's
134+
~~~~~~~~~~~~~~~~~~~~
135+
136+
.. code:: python
137+
138+
message = sendgrid.Mail()
139+
message.add_attachment('image.png', open('./image.png', 'rb'))
140+
message.add_content_id('image.png', 'ID_IN_HTML')
141+
message.set_html('<html><body>TEXT BEFORE IMAGE<img src="cid:ID_IN_HTML"></img>AFTER IMAGE</body></html>')
142+
133143
SendGrid's `X-SMTPAPI`_
134144
-----------------------
135145

@@ -178,10 +188,6 @@ There are implementations for setter methods too.
178188
message = sendgrid.Mail()
179189
message.add_filter("filter", "setting", "value")
180190
181-
TODO:
182-
~~~~~
183-
184-
- Add support for CID
185191
186192
Tests
187193
~~~~~

0 commit comments

Comments
 (0)