Skip to content

Commit cc24a6f

Browse files
Fixing merge conflicts
2 parents ac5ce27 + 021f045 commit cc24a6f

File tree

6 files changed

+51
-19
lines changed

6 files changed

+51
-19
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [1.5.15] - 2015-11-17 ##
5+
6+
### Added ###
7+
8+
- API Keys documentation for [POST, PATCH, DELETE]
9+
10+
## [1.5.14] - 2015-11-09 ##
11+
12+
### Fixed ###
13+
- Fix "Mail uses old-style class again" [144](https://github.com/sendgrid/sendgrid-python/issues/144)
14+
415
## [1.5.13] - 2015-10-28 ##
516

617
### Fixed ###

README.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,29 @@ List all API Keys belonging to the authenticated user.
248248
client = sendgrid.SendGridAPIClient('SENDGRID_API_KEY')
249249
status, msg = client.apikeys.get()
250250
251+
Generate a new API Key for the authenticated user
252+
253+
.. code:: python
254+
255+
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
256+
name = "My Amazing API Key"
257+
status, msg = client.apikeys.post(name)
258+
259+
Revoke an existing API Key
260+
261+
.. code:: python
262+
263+
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
264+
status, msg = client.apikeys.delete(api_key_id)
265+
266+
Update the name of an existing API Key
267+
268+
.. code:: python
269+
270+
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
271+
name = "My NEW API Key 3000"
272+
status, msg = client.apikeys.patch(api_key_id, name)
273+
251274
`Suppression Management`_
252275
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
253276

example_v2_test.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
sg = sendgrid.SendGridClient(os.environ.get('SENDGRID_API_KEY'))
1010

1111
"""
12-
1312
# Basic Send Example
1413
1514
message = sendgrid.Mail()
@@ -26,7 +25,7 @@
2625
2726
message = sendgrid.Mail()
2827
message.add_substitution(':first_name', 'John')
29-
message.smtpapi.add_to('Elmer Thomas <[email protected]>')
28+
message.smtpapi.add_to('John Doe <[email protected]>')
3029
message.set_subject('Testing from the Python library using the SMTPAPI')
3130
message.set_html('<b>:first_name, this was a successful test of using the SMTPAPI library!</b>')
3231
message.set_text(':name, this was a successful test of using the SMTPAPI library!')
@@ -36,19 +35,19 @@
3635
print msg
3736
3837
# Template Engine Example
39-
# In the template editor, the subject is <%subject%> and the body is:
38+
# In the template editor, the subject is <%subject%> and the body is:
4039
#
41-
# Hello :name,
40+
# Hello :name,
4241
#
43-
# <%body%>
42+
# <%body%>
4443
#
45-
# With Best Regards,
44+
# With Best Regards,
4645
#
47-
# Your Library Tester
46+
# Your Library Tester
4847
#
49-
# <%subject%> is replaced with the value in message.set_subject
50-
# <%body%> is replaced with the value in message.set_html and message.set_text
51-
# :name is replaced with the value in message.add_substitution
48+
# <%subject%> is replaced with the value in message.set_subject
49+
# <%body%> is replaced with the value in message.set_html and message.set_text
50+
# :name is replaced with the value in message.add_substitution
5251
5352
message = sendgrid.Mail()
5453
message.add_filter('templates', 'enable', '1')

example_v3_test.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
1212

1313
"""
14-
15-
14+
1615
status, msg = client.asm_global_suppressions.delete(email)
1716
print status
1817
print msg
@@ -21,7 +20,7 @@
2120
print status
2221
print msg
2322
24-
status, msg = client.asm_global_suppressions.post(['elmer.thomas+test_global0@gmail.com'])
23+
status, msg = client.asm_global_suppressions.post(['example@example.com'])
2524
print status
2625
print msg
2726
@@ -47,24 +46,24 @@
4746
print msg
4847
4948
# In the global suppression list
50-
status, msg = client.asm_global_suppressions.get('elmer.thomas+test_global@gmail.com')
49+
status, msg = client.asm_global_suppressions.get('example@example.com')
5150
print status
5251
print msg
5352
5453
# Not in the global suppression list
55-
status, msg = client.asm_global_suppressions.get('elmer.thomas@gmail.com')
54+
status, msg = client.asm_global_suppressions.get('example@example.com')
5655
print status
5756
print msg
5857
5958
status, msg = client.apikeys.get()
6059
print status
6160
print msg
6261
63-
status, msg = client.asm_suppressions.delete(67,'elmer+test@thinkingserious.com')
62+
status, msg = client.asm_suppressions.delete(67,'example@example.com')
6463
print status
6564
print msg
6665
67-
status, msg = client.asm_suppressions.post(60, ['elmer+test@thinkingserious.com', 'elmer.thomas@yahoo.com'])
66+
status, msg = client.asm_suppressions.post(60, ['example@example.com', 'example@example.com])
6867
print status
6968
print msg
7069

sendgrid/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from smtpapi import SMTPAPIHeader
99

1010

11-
class Mail():
11+
class Mail(object):
1212

1313
"""SendGrid Message."""
1414

sendgrid/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version_info = (1, 5, 13)
1+
version_info = (1, 5, 15)
22
__version__ = '.'.join(str(v) for v in version_info)

0 commit comments

Comments
 (0)