We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42eb39a commit 131bc62Copy full SHA for 131bc62
examples/transmissions/a-file.txt
@@ -0,0 +1 @@
1
+Woo hoo! This attachment was added via python-sparkpost.
examples/transmissions/send_transmission.py
@@ -1,5 +1,10 @@
+import os
2
+
3
from sparkpost import SparkPost
4
5
+parent_dir = os.path.dirname(os.path.realpath(__file__))
6
+attachment_path = os.path.abspath(os.path.join(parent_dir, "a-file.txt"))
7
8
sp = SparkPost()
9
10
response = sp.transmissions.send(
@@ -23,6 +28,13 @@
23
28
},
24
29
track_opens=True,
25
30
track_clicks=True,
31
+ attachments=[
32
+ {
33
+ "name": "test.txt",
34
+ "type": "text/plain",
35
+ "filename": attachment_path
36
+ }
37
+ ],
26
38
campaign='sdk example',
27
39
metadata={
40
'key': 'value',
0 commit comments