-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from SparkPost/ISSUE-51
Remove YOUR API KEY references from examples
- Loading branch information
Showing
26 changed files
with
90 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.py] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
result = sp.recipient_lists.delete('list_id') | ||
print result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
recipient_list = sp.recipient_lists.get('list_id') | ||
print recipient_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
recipient_list = sp.recipient_lists.get('list_id', True) | ||
print recipient_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
recipient_lists = sp.recipient_lists.list() | ||
print recipient_lists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
result = sp.suppression_list.delete('test@test.com') | ||
print result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
entry = sp.suppression_list.get('test@test.com') | ||
print entry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
|
||
response = sp.templates.create( | ||
id='TEST_ID', | ||
name='Test Template', | ||
from_email='test@test.com', | ||
subject='Test email template!', | ||
html='<b>This is a test email template!</b>' | ||
) | ||
|
||
print response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
result = sp.templates.delete('template_id') | ||
print result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
template = sp.templates.get('template_id') | ||
print template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
template_list = sp.templates.list() | ||
print template_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
trans = sp.transmission.get('transmission_id') | ||
print trans | ||
sp = SparkPost() | ||
transmission = sp.transmission.get('transmission_id') | ||
print transmission |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
transmission_list = sp.transmission.list() | ||
print transmission_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
|
||
response = sp.transmission.send( | ||
recipients = [ | ||
'postmaster@example.com', | ||
'you@me.com', | ||
{ | ||
'address': { | ||
'email': 'john.doe@example.com', | ||
'name': 'John Doe' | ||
} | ||
} | ||
], | ||
html = '<p>Hello world {{name}}</p>', | ||
text = 'Hello world {{name}}', | ||
from_email = 'test@sparkpostbox.com', | ||
subject = 'Example Script', | ||
description = 'contrived example', | ||
custom_headers = { | ||
'X-CUSTOM-HEADER': 'foo bar' | ||
}, | ||
track_opens = True, | ||
track_clicks = True, | ||
campaign = 'sdk example', | ||
metadata = { | ||
'key': 'value', | ||
'arbitrary': 'values' | ||
}, | ||
substitution_data = { | ||
'name': 'Example User' | ||
}, | ||
reply_to = 'no-reply@sparkpostmail.com' | ||
recipients=[ | ||
'postmaster@example.com', | ||
'you@me.com', | ||
{ | ||
'address': { | ||
'email': 'john.doe@example.com', | ||
'name': 'John Doe' | ||
} | ||
} | ||
], | ||
html='<p>Hello world {{name}}</p>', | ||
text='Hello world {{name}}', | ||
from_email='test@sparkpostbox.com', | ||
subject='Example Script', | ||
description='contrived example', | ||
custom_headers={ | ||
'X-CUSTOM-HEADER': 'foo bar' | ||
}, | ||
track_opens=True, | ||
track_clicks=True, | ||
campaign='sdk example', | ||
metadata={ | ||
'key': 'value', | ||
'arbitrary': 'values' | ||
}, | ||
substitution_data={ | ||
'name': 'Example User' | ||
}, | ||
reply_to='no-reply@sparkpostmail.com' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
|
||
response = sp.transmission.send( | ||
recipient_list = 'my_list', | ||
html = '<p>Hello world {{name}}</p>', | ||
text = 'Hello world {{name}}', | ||
from_email = 'test@sparkpostbox.com', | ||
subject = 'Example Script', | ||
description = 'contrived example', | ||
custom_headers = { | ||
'X-CUSTOM-HEADER': 'foo bar' | ||
}, | ||
campaign = 'sdk example', | ||
metadata = { | ||
'key': 'value', | ||
'arbitrary': 'values' | ||
}, | ||
substitution_data = { | ||
'name': 'Example User' | ||
}, | ||
reply_to = 'no-reply@sparkpostmail.com' | ||
recipient_list='my_list', | ||
html='<p>Hello world {{name}}</p>', | ||
text='Hello world {{name}}', | ||
from_email='test@sparkpostbox.com', | ||
subject='Example Script', | ||
description='contrived example', | ||
custom_headers={ | ||
'X-CUSTOM-HEADER': 'foo bar' | ||
}, | ||
campaign='sdk example', | ||
metadata={ | ||
'key': 'value', | ||
'arbitrary': 'values' | ||
}, | ||
substitution_data={ | ||
'name': 'Example User' | ||
}, | ||
reply_to='no-reply@sparkpostmail.com' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from sparkpost import SparkPost | ||
|
||
sp = SparkPost('YOUR API KEY') | ||
sp = SparkPost() | ||
|
||
response = sp.transmission.send( | ||
recipients = ['you@me.com'], | ||
template = 'my-template-id', | ||
use_draft_template = True | ||
recipients=['you@me.com'], | ||
template='my-template-id', | ||
use_draft_template=True | ||
) |