Skip to content

Commit 0d935e8

Browse files
committed
Merge pull request #81 from SparkPost/ISSUE-80
Update docs to describe attachments format properly
2 parents 366d669 + 888be02 commit 0d935e8

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

sparkpost/transmissions.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,27 @@ def send(self, **kwargs):
145145
:param dict substitution_data: Corresponds to substitutions in
146146
html/text content. See `substitutions reference
147147
<https://www.sparkpost.com/docs/substitutions-reference>`_.
148-
:param dict attachments: Corresponds to attachments.
149-
See `Attachment Attributes reference
150-
<https://developers.sparkpost.com/api/#/reference/transmissions>`_.
151-
Replace `data` by `filename` if you want the library to perform
152-
the base64 conversion. Example: `"filename": "/full/path/test.txt"`
148+
:param attachments: List of dicts. For example:
149+
150+
.. code-block:: python
151+
152+
dict(
153+
type='application/pdf',
154+
name='document.pdf',
155+
data='base64 encoded string'
156+
)
157+
158+
Replace `data` with `filename` if you want the library to perform
159+
the base64 conversion. For example:
160+
161+
.. code-block:: python
162+
163+
dict(
164+
type='application/pdf',
165+
name='document.pdf',
166+
filename='/full/path/to/document.pdf'
167+
)
168+
153169
:param str start_time: Delay generation of messages until this
154170
datetime. Format YYYY-MM-DDTHH:MM:SS+-HH:MM. Example:
155171
'2015-02-11T08:00:00-04:00'.

0 commit comments

Comments
 (0)