Skip to content

Commit dd392cf

Browse files
committed
Merge pull request #43 from SparkPost/issue-17-pick
Removed default of true on track opens/clicks
2 parents 56fbe5f + 7c80047 commit dd392cf

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

docs/resources/transmissions.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Here at SparkPost, our messages are known as transmissions. Let's use the underl
1313
recipients=['someone@somedomain.com'],
1414
html='<p>Hello world</p>',
1515
from_email='test@sparkpostbox.com',
16-
subject='Hello from python-sparkpost'
16+
subject='Hello from python-sparkpost',
17+
track_opens=True,
18+
track_clicks=True
1719
)
1820
1921
print response
@@ -46,7 +48,9 @@ Using inline templates and/or recipients
4648
text="Hello world",
4749
html='<p>Hello world</p>',
4850
from_email='test@sparkpostbox.com',
49-
subject='Hello from python-sparkpost'
51+
subject='Hello from python-sparkpost',
52+
track_opens=True,
53+
track_clicks=True
5054
)
5155
5256

examples/transmissions/send_transmission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
custom_headers = {
2222
'X-CUSTOM-HEADER': 'foo bar'
2323
},
24-
track_opens = False,
25-
track_clicks = False,
24+
track_opens = True,
25+
track_clicks = True,
2626
campaign = 'sdk example',
2727
metadata = {
2828
'key': 'value',

sparkpost/transmissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def _translate_keys(self, **kwargs):
2626
model['metadata'] = kwargs.get('metadata')
2727
model['substitution_data'] = kwargs.get('substitution_data')
2828

29-
model['options']['open_tracking'] = kwargs.get('track_opens', True)
30-
model['options']['click_tracking'] = kwargs.get('track_clicks', True)
29+
model['options']['open_tracking'] = kwargs.get('track_opens')
30+
model['options']['click_tracking'] = kwargs.get('track_clicks')
3131
model['options']['sandbox'] = kwargs.get('use_sandbox')
3232

3333
model['content']['use_draft_template'] = \

test/test_transmissions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ def test_translate_keys_with_list():
1010
t = Transmissions('uri', 'key')
1111
results = t._translate_keys(recipient_list='test')
1212
assert results['return_path'] == 'default@sparkpostmail.com'
13-
assert results['options']['open_tracking'] is True
14-
assert results['options']['click_tracking'] is True
1513
assert results['content']['use_draft_template'] is False
1614
assert results['recipients'] == {'list_id': 'test'}
1715

0 commit comments

Comments
 (0)