Skip to content

Commit ecc37bb

Browse files
author
Andrii Soldatenko
committed
Fixed conflicts
2 parents 759c018 + 210ae35 commit ecc37bb

6 files changed

Lines changed: 229 additions & 6 deletions

File tree

CHANGELOG.md

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

4+
## [3.6.3] - 2016-11-10 ##
5+
### Updated
6+
- Pull #243 [Update deprecated Heroku command](https://github.com/sendgrid/sendgrid-python/pull/243)
7+
- Big thanks to [Roberto Ortega](https://github.com/berto) for the pull request!
8+
9+
## [3.6.2] - 2016-11-10 ##
10+
### Fixed
11+
- Pull #240 [Add six to requirements.txt](https://github.com/sendgrid/sendgrid-python/pull/246)
12+
- Big thanks to [Wataru Sato](https://github.com/awwa) for the pull request!
13+
14+
## [3.6.1] - 2016-11-10 ##
15+
### Fixed
16+
- Pull #246 [Typo 'user' for 'usr'](https://github.com/sendgrid/sendgrid-python/pull/246)
17+
- Big thanks to [Mike Ralphson](https://github.com/MikeRalphson) for the pull request!
18+
419
## [3.6.0] - 2016-10-11 ##
520
### Added
621
- Pull #234 [Substitutions allow non-strings for values](https://github.com/sendgrid/sendgrid-python/pull/234)

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Flask==0.10.1
22
PyYAML==3.11
3-
python-http-client==2.2.1
3+
python-http-client==2.2.1
4+
six==1.10.0

sendgrid/helpers/inbound/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ To make changes: clone, modify and push the changes.
9191

9292
For example:
9393
```bash
94-
heroku clone -a name-of-your-app
95-
vim config.yml
94+
git clone https://github.com/sendgrid/sendgrid-python.git
95+
heroku git:remote -a [name-of-your-app]
96+
---make changes---
9697
git add .
9798
git commit -m "update configuration"
9899
git push heroku master

sendgrid/version.py

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

test/test_mail.py

Lines changed: 207 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333

3434
class UnitTests(unittest.TestCase):
35+
3536
def test_helloEmail(self):
3637
self.maxDiff = None
3738

@@ -207,6 +208,211 @@ def test_kitchenSink(self):
207208

208209
mail.set_reply_to(Email("test@example.com"))
209210

211+
expected_result = {
212+
"asm": {
213+
"group_id": 99,
214+
"groups_to_display": [4, 5, 6, 7, 8]
215+
},
216+
"attachments": [
217+
{
218+
"content": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3"
219+
"RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12",
220+
"content_id": "Balance Sheet",
221+
"disposition": "attachment",
222+
"filename": "balance_001.pdf",
223+
"type": "application/pdf"
224+
},
225+
{
226+
"content": "BwdW",
227+
"content_id": "Banner",
228+
"disposition": "inline",
229+
"filename": "banner.png",
230+
"type": "image/png"
231+
}
232+
],
233+
"batch_id": "sendgrid_batch_id",
234+
"categories": [
235+
"May",
236+
"2016"
237+
],
238+
"content": [
239+
{
240+
"type": "text/plain",
241+
"value": "some text here"
242+
},
243+
{
244+
"type": "text/html",
245+
"value": "<html><body>some text here</body></html>"
246+
}
247+
],
248+
"custom_args": {
249+
"campaign": "welcome",
250+
"weekday": "morning"
251+
},
252+
"from": {
253+
"email": "test@example.com",
254+
"name": "Example User"
255+
},
256+
"headers": {
257+
"X-Test1": "test1",
258+
"X-Test3": "test2",
259+
"X-Test4": "test4"
260+
},
261+
"ip_pool_name": "24",
262+
"mail_settings": {
263+
"bcc": {
264+
"email": "test@example.com",
265+
"enable": True
266+
},
267+
"bypass_list_management": {
268+
"enable": True
269+
},
270+
"footer": {
271+
"enable": True,
272+
"html": "<html><body>Footer Text</body></html>",
273+
"text": "Footer Text"
274+
},
275+
"sandbox_mode": {
276+
"enable": True
277+
},
278+
"spam_check": {
279+
"enable": True,
280+
"post_to_url": "https://spamcatcher.sendgrid.com",
281+
"threshold": 1
282+
}
283+
},
284+
"personalizations": [
285+
{
286+
"bcc": [
287+
{
288+
"email": "test@example.com"
289+
},
290+
{
291+
"email": "test@example.com"
292+
}
293+
],
294+
"cc": [
295+
{
296+
"email": "test@example.com",
297+
"name": "Example User"
298+
},
299+
{
300+
"email": "test@example.com",
301+
"name": "Example User"
302+
}
303+
],
304+
"custom_args": {
305+
"type": "marketing",
306+
"user_id": "343"
307+
},
308+
"headers": {
309+
"X-Mock": "true",
310+
"X-Test": "test"
311+
},
312+
"send_at": 1443636843,
313+
"subject": "Hello World from the Personalized SendGrid "
314+
"Python Library",
315+
"substitutions": {
316+
"%city%": "Denver",
317+
"%name%": "Example User"
318+
},
319+
"to": [
320+
{
321+
"email": "test@example.com",
322+
"name": "Example User"
323+
},
324+
{
325+
"email": "test@example.com",
326+
"name": "Example User"
327+
}
328+
]
329+
},
330+
{
331+
"bcc": [
332+
{
333+
"email": "test@example.com"
334+
},
335+
{
336+
"email": "test@example.com"
337+
}
338+
],
339+
"cc": [
340+
{
341+
"email": "test@example.com",
342+
"name": "Example User"
343+
},
344+
{
345+
"email": "test@example.com",
346+
"name": "Example User"
347+
}
348+
],
349+
"custom_args": {
350+
"type": "marketing",
351+
"user_id": "343"
352+
},
353+
"headers": {
354+
"X-Mock": "true",
355+
"X-Test": "test"
356+
},
357+
"send_at": 1443636843,
358+
"subject": "Hello World from the Personalized SendGrid "
359+
"Python Library",
360+
"substitutions": {
361+
"%city%": "Denver",
362+
"%name%": "Example User"
363+
},
364+
"to": [
365+
{
366+
"email": "test@example.com",
367+
"name": "Example User"
368+
},
369+
{
370+
"email": "test@example.com",
371+
"name": "Example User"
372+
}
373+
]
374+
}
375+
],
376+
"reply_to": {
377+
"email": "test@example.com"
378+
},
379+
"sections": {
380+
"%section1%": "Substitution Text for Section 1",
381+
"%section2%": "Substitution Text for Section 2"
382+
},
383+
"send_at": 1443636842,
384+
"subject": "Hello World from the SendGrid Python Library",
385+
"template_id": "13b8f94f-bcae-4ec6-b752-70d6cb59f932",
386+
"tracking_settings": {
387+
"click_tracking": {
388+
"enable": True,
389+
"enable_text": True
390+
},
391+
"ganalytics": {
392+
"enable": True,
393+
"utm_campaign": "some campaign",
394+
"utm_content": "some content",
395+
"utm_medium": "some medium",
396+
"utm_source": "some source",
397+
"utm_term": "some term"
398+
},
399+
"open_tracking": {
400+
"enable": True,
401+
"substitution_tag": "Optional tag to replace with the "
402+
"open image in the body of the message"
403+
},
404+
"subscription_tracking": {
405+
"enable": True,
406+
"html": "<html><body>html to insert into the text/html "
407+
"portion of the message</body></html>",
408+
"substitution_tag": "Optional tag to replace with the open"
409+
" image in the body of the message",
410+
"text": "text to insert into the text/plain portion of"
411+
" the message"
412+
}
413+
}
414+
}
210415
self.assertEqual(
211416
json.dumps(mail.get(), sort_keys=True),
212-
'{"asm": {"group_id": 99, "groups_to_display": [4, 5, 6, 7, 8]}, "attachments": [{"content": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12", "content_id": "Balance Sheet", "disposition": "attachment", "filename": "balance_001.pdf", "type": "application/pdf"}, {"content": "BwdW", "content_id": "Banner", "disposition": "inline", "filename": "banner.png", "type": "image/png"}], "batch_id": "sendgrid_batch_id", "categories": ["May", "2016"], "content": [{"type": "text/plain", "value": "some text here"}, {"type": "text/html", "value": "<html><body>some text here</body></html>"}], "custom_args": {"campaign": "welcome", "weekday": "morning"}, "from": {"email": "test@example.com", "name": "Example User"}, "headers": {"X-Test1": "test1", "X-Test3": "test2", "X-Test4": "test4"}, "ip_pool_name": "24", "mail_settings": {"bcc": {"email": "test@example.com", "enable": true}, "bypass_list_management": {"enable": true}, "footer": {"enable": true, "html": "<html><body>Footer Text</body></html>", "text": "Footer Text"}, "sandbox_mode": {"enable": true}, "spam_check": {"enable": true, "post_to_url": "https://spamcatcher.sendgrid.com", "threshold": 1}}, "personalizations": [{"bcc": [{"email": "test@example.com"}, {"email": "test@example.com"}], "cc": [{"email": "test@example.com", "name": "Example User"}, {"email": "test@example.com", "name": "Example User"}], "custom_args": {"type": "marketing", "user_id": "343"}, "headers": {"X-Mock": "true", "X-Test": "test"}, "send_at": 1443636843, "subject": "Hello World from the Personalized SendGrid Python Library", "substitutions": {"%city%": "Denver", "%name%": "Example User"}, "to": [{"email": "test@example.com", "name": "Example User"}, {"email": "test@example.com", "name": "Example User"}]}, {"bcc": [{"email": "test@example.com"}, {"email": "test@example.com"}], "cc": [{"email": "test@example.com", "name": "Example User"}, {"email": "test@example.com", "name": "Example User"}], "custom_args": {"type": "marketing", "user_id": "343"}, "headers": {"X-Mock": "true", "X-Test": "test"}, "send_at": 1443636843, "subject": "Hello World from the Personalized SendGrid Python Library", "substitutions": {"%city%": "Denver", "%name%": "Example User"}, "to": [{"email": "test@example.com", "name": "Example User"}, {"email": "test@example.com", "name": "Example User"}]}], "reply_to": {"email": "test@example.com"}, "sections": {"%section1%": "Substitution Text for Section 1", "%section2%": "Substitution Text for Section 2"}, "send_at": 1443636842, "subject": "Hello World from the SendGrid Python Library", "template_id": "13b8f94f-bcae-4ec6-b752-70d6cb59f932", "tracking_settings": {"click_tracking": {"enable": true, "enable_text": true}, "ganalytics": {"enable": true, "utm_campaign": "some campaign", "utm_content": "some content", "utm_medium": "some medium", "utm_source": "some source", "utm_term": "some term"}, "open_tracking": {"enable": true, "substitution_tag": "Optional tag to replace with the open image in the body of the message"}, "subscription_tracking": {"enable": true, "html": "<html><body>html to insert into the text/html portion of the message</body></html>", "substitution_tag": "Optional tag to replace with the open image in the body of the message", "text": "text to insert into the text/plain portion of the message"}}}')
417+
json.dumps(expected_result, sort_keys=True)
418+
)

test/test_sendgrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def setUpClass(cls):
3939
"Error downloading the prism binary, you can try "
4040
"downloading directly here "
4141
"(https://github.com/stoplightio/prism/releases) "
42-
"and place in your /user/local/bin directory",
42+
"and place in your /usr/local/bin directory",
4343
e.read())
4444
sys.exit()
4545
else:

0 commit comments

Comments
 (0)