@@ -16,58 +16,58 @@ def test_helloEmail(self):
1616 """Minimum required to send an email"""
1717 mail = Mail ()
1818
19- mail .set_from (Email ("dx@sendgrid .com" ))
19+ mail .set_from (Email ("test@example .com" ))
2020
2121 mail .set_subject ("Hello World from the SendGrid Python Library" )
2222
2323 personalization = Personalization ()
24- personalization .add_to (Email ("elmer.thomas@sendgrid .com" ))
24+ personalization .add_to (Email ("test@example .com" ))
2525 mail .add_personalization (personalization )
2626
2727 mail .add_content (Content ("text/plain" , "some text here" ))
2828 mail .add_content (Content ("text/html" , "<html><body>some text here</body></html>" ))
2929
30- self .assertEqual (json .dumps (mail .get (), sort_keys = True ), '{"content": [{"type": "text/plain", "value": "some text here"}, {"type": "text/html", "value": "<html><body>some text here</body></html>"}], "from": {"email": "dx@sendgrid .com"}, "personalizations": [{"to": [{"email": "elmer.thomas@sendgrid .com"}]}], "subject": "Hello World from the SendGrid Python Library"}' )
30+ self .assertEqual (json .dumps (mail .get (), sort_keys = True ), '{"content": [{"type": "text/plain", "value": "some text here"}, {"type": "text/html", "value": "<html><body>some text here</body></html>"}], "from": {"email": "test@example .com"}, "personalizations": [{"to": [{"email": "test@example .com"}]}], "subject": "Hello World from the SendGrid Python Library"}' )
3131
3232 def test_kitchenSink (self ):
3333 self .maxDiff = None
3434
3535 """All settings set"""
3636 mail = Mail ()
3737
38- mail .set_from (Email ("dx@sendgrid .com" , "Elmer Thomas " ))
38+ mail .set_from (Email ("test@example .com" , "Example User " ))
3939
4040 mail .set_subject ("Hello World from the SendGrid Python Library" )
4141
4242 personalization = Personalization ()
43- personalization .add_to (Email ("elmer.thomas@sendgrid .com" , "Elmer Thomas " ))
44- personalization .add_to (Email ("elmer.thomas@gmail .com" , "Elmer Thomas Alias " ))
45- personalization .add_cc (Email ("matt.bernier@sendgrid .com" , "Matt Bernier " ))
46- personalization .add_cc (Email ("eric.shallock@sendgrid .com" , "Eric Shallock " ))
47- personalization .add_bcc (Email ("matt.bernier+dx@sendgrid .com" ))
48- personalization .add_bcc (Email ("eric.shallock+dx@sendgrid .com" ))
43+ personalization .add_to (Email ("test@example .com" , "Example User " ))
44+ personalization .add_to (Email ("test@example .com" , "Example User " ))
45+ personalization .add_cc (Email ("test@example .com" , "Example User " ))
46+ personalization .add_cc (Email ("test@example .com" , "Example User " ))
47+ personalization .add_bcc (Email ("test@example .com" ))
48+ personalization .add_bcc (Email ("test@example .com" ))
4949 personalization .set_subject ("Hello World from the Personalized SendGrid Python Library" )
5050 personalization .add_header (Header ("X-Test" , "test" ))
5151 personalization .add_header (Header ("X-Mock" , "true" ))
52- personalization .add_substitution (Substitution ("%name%" , "Tim " ))
53- personalization .add_substitution (Substitution ("%city%" , "Riverside " ))
52+ personalization .add_substitution (Substitution ("%name%" , "Example User " ))
53+ personalization .add_substitution (Substitution ("%city%" , "Denver " ))
5454 personalization .add_custom_arg (CustomArg ("user_id" , "343" ))
5555 personalization .add_custom_arg (CustomArg ("type" , "marketing" ))
5656 personalization .set_send_at (1443636843 )
5757 mail .add_personalization (personalization )
5858
5959 personalization2 = Personalization ()
60- personalization2 .add_to (Email ("elmer.thomas@sendgrid .com" , "Elmer Thomas " ))
61- personalization2 .add_to (Email ("elmer.thomas@gmail .com" , "Elmer Thomas Alias " ))
62- personalization2 .add_cc (Email ("matt.bernier@sendgrid .com" , "Matt Bernier " ))
63- personalization2 .add_cc (Email ("eric.shallock@sendgrid .com" , "Eric Shallock " ))
64- personalization2 .add_bcc (Email ("matt.bernier+dx@sendgrid .com" ))
65- personalization2 .add_bcc (Email ("eric.shallock+dx@sendgrid .com" ))
60+ personalization2 .add_to (Email ("test@example .com" , "Example User " ))
61+ personalization2 .add_to (Email ("test@example .com" , "Example User " ))
62+ personalization2 .add_cc (Email ("test@example .com" , "Example User " ))
63+ personalization2 .add_cc (Email ("test@example .com" , "Example User " ))
64+ personalization2 .add_bcc (Email ("test@example .com" ))
65+ personalization2 .add_bcc (Email ("test@example .com" ))
6666 personalization2 .set_subject ("Hello World from the Personalized SendGrid Python Library" )
6767 personalization2 .add_header (Header ("X-Test" , "test" ))
6868 personalization2 .add_header (Header ("X-Mock" , "true" ))
69- personalization2 .add_substitution (Substitution ("%name%" , "Tim " ))
70- personalization2 .add_substitution (Substitution ("%city%" , "Riverside " ))
69+ personalization2 .add_substitution (Substitution ("%name%" , "Example User " ))
70+ personalization2 .add_substitution (Substitution ("%city%" , "Denver " ))
7171 personalization2 .add_custom_arg (CustomArg ("user_id" , "343" ))
7272 personalization2 .add_custom_arg (CustomArg ("type" , "marketing" ))
7373 personalization2 .set_send_at (1443636843 )
@@ -115,7 +115,7 @@ def test_kitchenSink(self):
115115 mail .set_ip_pool_name ("24" )
116116
117117 mail_settings = MailSettings ()
118- mail_settings .set_bcc_settings (BCCSettings (True , Email ("dx+reply@sendgrid .com" )))
118+ mail_settings .set_bcc_settings (BCCSettings (True , Email ("test@example .com" )))
119119 mail_settings .set_bypass_list_management (BypassListManagement (True ))
120120 mail_settings .set_footer_settings (FooterSettings (True , "Footer Text" , "<html><body>Footer Text</body></html>" ))
121121 mail_settings .set_sandbox_mode (SandBoxMode (True ))
@@ -129,6 +129,6 @@ def test_kitchenSink(self):
129129 tracking_settings .set_ganalytics (Ganalytics (True , "some source" , "some medium" , "some term" , "some content" , "some campaign" ))
130130 mail .set_tracking_settings (tracking_settings )
131131
132- mail .set_reply_to (Email ("dx+reply@sendgrid .com" ))
132+ mail .set_reply_to (Email ("test@example .com" ))
133133
134- self .assertEqual (json .dumps (mail .get (), sort_keys = True ), '{"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": "dx@sendgrid.com", "name": "Elmer Thomas"}, "headers": {"X-Test1": "test1", "X-Test3": "test2"}, "ip_pool_name": "24", "mail_settings": {"bcc": {"email": "dx+reply@sendgrid.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": "matt.bernier+dx@sendgrid.com"}, {"email": "eric.shallock+dx@sendgrid.com"}], "cc": [{"email": "matt.bernier@sendgrid.com", "name": "Matt Bernier"}, {"email": "eric.shallock@sendgrid.com", "name": "Eric Shallock"}], "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%": "Riverside", "%name%": "Tim"}, "to": [{"email": "elmer.thomas@sendgrid.com", "name": "Elmer Thomas"}, {"email": "elmer.thomas@gmail.com", "name": "Elmer Thomas Alias"}]}, {"bcc": [{"email": "matt.bernier+dx@sendgrid.com"}, {"email": "eric.shallock+dx@sendgrid.com"}], "cc": [{"email": "matt.bernier@sendgrid.com", "name": "Matt Bernier"}, {"email": "eric.shallock@sendgrid.com", "name": "Eric Shallock"}], "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%": "Riverside", "%name%": "Tim"}, "to": [{"email": "elmer.thomas@sendgrid.com", "name": "Elmer Thomas"}, {"email": "elmer.thomas@gmail.com", "name": "Elmer Thomas Alias"}]}], "reply_to": {"email": "dx+reply@sendgrid.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"}}}' )
134+ self .assertEqual (json .dumps (mail .get (), sort_keys = True ), '{"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"}, "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"}}}' )
0 commit comments