Skip to content

Commit

Permalink
Merge pull request #43 from SparkPost/issue-17-pick
Browse files Browse the repository at this point in the history
Removed default of true on track opens/clicks
  • Loading branch information
richleland committed Aug 23, 2015
2 parents 56fbe5f + 7c80047 commit dd392cf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 6 additions & 2 deletions docs/resources/transmissions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Here at SparkPost, our messages are known as transmissions. Let's use the underl
recipients=['someone@somedomain.com'],
html='<p>Hello world</p>',
from_email='test@sparkpostbox.com',
subject='Hello from python-sparkpost'
subject='Hello from python-sparkpost',
track_opens=True,
track_clicks=True
)
print response
Expand Down Expand Up @@ -46,7 +48,9 @@ Using inline templates and/or recipients
text="Hello world",
html='<p>Hello world</p>',
from_email='test@sparkpostbox.com',
subject='Hello from python-sparkpost'
subject='Hello from python-sparkpost',
track_opens=True,
track_clicks=True
)
Expand Down
4 changes: 2 additions & 2 deletions examples/transmissions/send_transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
custom_headers = {
'X-CUSTOM-HEADER': 'foo bar'
},
track_opens = False,
track_clicks = False,
track_opens = True,
track_clicks = True,
campaign = 'sdk example',
metadata = {
'key': 'value',
Expand Down
4 changes: 2 additions & 2 deletions sparkpost/transmissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def _translate_keys(self, **kwargs):
model['metadata'] = kwargs.get('metadata')
model['substitution_data'] = kwargs.get('substitution_data')

model['options']['open_tracking'] = kwargs.get('track_opens', True)
model['options']['click_tracking'] = kwargs.get('track_clicks', True)
model['options']['open_tracking'] = kwargs.get('track_opens')
model['options']['click_tracking'] = kwargs.get('track_clicks')
model['options']['sandbox'] = kwargs.get('use_sandbox')

model['content']['use_draft_template'] = \
Expand Down
2 changes: 0 additions & 2 deletions test/test_transmissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def test_translate_keys_with_list():
t = Transmissions('uri', 'key')
results = t._translate_keys(recipient_list='test')
assert results['return_path'] == 'default@sparkpostmail.com'
assert results['options']['open_tracking'] is True
assert results['options']['click_tracking'] is True
assert results['content']['use_draft_template'] is False
assert results['recipients'] == {'list_id': 'test'}

Expand Down

0 comments on commit dd392cf

Please sign in to comment.