-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version Bump v4.0.0: BREAKING CHANGE #244
- Loading branch information
1 parent
8b11b6e
commit 65943e4
Showing
4 changed files
with
71 additions
and
39 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
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 |
---|---|---|
|
@@ -21,9 +21,9 @@ def build_kitchen_sink(): | |
"""All settings set""" | ||
mail = Mail() | ||
|
||
mail.set_from(Email("[email protected]", "Example User")) | ||
mail.from_email = Email("[email protected]", "Example User") | ||
|
||
mail.set_subject("Hello World from the SendGrid Python Library") | ||
mail.subject = "Hello World from the SendGrid Python Library" | ||
|
||
personalization = Personalization() | ||
personalization.add_to(Email("[email protected]", "Example User")) | ||
|
@@ -32,14 +32,14 @@ def build_kitchen_sink(): | |
personalization.add_cc(Email("[email protected]", "Example User")) | ||
personalization.add_bcc(Email("[email protected]")) | ||
personalization.add_bcc(Email("[email protected]")) | ||
personalization.set_subject("Hello World from the Personalized SendGrid Python Library") | ||
personalization.subject = "Hello World from the Personalized SendGrid Python Library" | ||
personalization.add_header(Header("X-Test", "test")) | ||
personalization.add_header(Header("X-Mock", "true")) | ||
personalization.add_substitution(Substitution("%name%", "Example User")) | ||
personalization.add_substitution(Substitution("%city%", "Denver")) | ||
personalization.add_custom_arg(CustomArg("user_id", "343")) | ||
personalization.add_custom_arg(CustomArg("type", "marketing")) | ||
personalization.set_send_at(1443636843) | ||
personalization.send_at = 1443636843 | ||
mail.add_personalization(personalization) | ||
|
||
personalization2 = Personalization() | ||
|
@@ -49,36 +49,36 @@ def build_kitchen_sink(): | |
personalization2.add_cc(Email("[email protected]", "Eric Shallock")) | ||
personalization2.add_bcc(Email("[email protected]")) | ||
personalization2.add_bcc(Email("[email protected]")) | ||
personalization2.set_subject("Hello World from the Personalized SendGrid Python Library") | ||
personalization2.subject = "Hello World from the Personalized SendGrid Python Library" | ||
personalization2.add_header(Header("X-Test", "test")) | ||
personalization2.add_header(Header("X-Mock", "true")) | ||
personalization2.add_substitution(Substitution("%name%", "Example User")) | ||
personalization2.add_substitution(Substitution("%city%", "Denver")) | ||
personalization2.add_custom_arg(CustomArg("user_id", "343")) | ||
personalization2.add_custom_arg(CustomArg("type", "marketing")) | ||
personalization2.set_send_at(1443636843) | ||
personalization2.send_at = 1443636843 | ||
mail.add_personalization(personalization2) | ||
|
||
mail.add_content(Content("text/plain", "some text here")) | ||
mail.add_content(Content("text/html", "<html><body>some text here</body></html>")) | ||
|
||
attachment = Attachment() | ||
attachment.set_content("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12") | ||
attachment.set_type("application/pdf") | ||
attachment.set_filename("balance_001.pdf") | ||
attachment.set_disposition("attachment") | ||
attachment.set_content_id("Balance Sheet") | ||
attachment.content = "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12" | ||
attachment.type = "application/pdf" | ||
attachment.filename = "balance_001.pdf" | ||
attachment.disposition = "attachment" | ||
attachment.content_id = "Balance Sheet" | ||
mail.add_attachment(attachment) | ||
|
||
attachment2 = Attachment() | ||
attachment2.set_content("BwdW") | ||
attachment2.set_type("image/png") | ||
attachment2.set_filename("banner.png") | ||
attachment2.set_disposition("inline") | ||
attachment2.set_content_id("Banner") | ||
attachment2.content = "BwdW" | ||
attachment2.type = "image/png" | ||
attachment2.filename = "banner.png" | ||
attachment2.disposition = "inline" | ||
attachment2.content_id = "Banner" | ||
mail.add_attachment(attachment2) | ||
|
||
mail.set_template_id("13b8f94f-bcae-4ec6-b752-70d6cb59f932") | ||
mail.template_id = "13b8f94f-bcae-4ec6-b752-70d6cb59f932" | ||
|
||
mail.add_section(Section("%section1%", "Substitution Text for Section 1")) | ||
mail.add_section(Section("%section2%", "Substitution Text for Section 2")) | ||
|
@@ -92,31 +92,31 @@ def build_kitchen_sink(): | |
mail.add_custom_arg(CustomArg("campaign", "welcome")) | ||
mail.add_custom_arg(CustomArg("weekday", "morning")) | ||
|
||
mail.set_send_at(1443636842) | ||
mail.send_at = 1443636842 | ||
|
||
# This must be a valid [batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) to work | ||
# mail.set_batch_id("N2VkYjBjYWItMGU4OC0xMWU2LWJhMzYtZjQ1Yzg5OTBkNzkxLWM5ZTUyZjNhOA") | ||
|
||
mail.set_asm(ASM(99, [4, 5, 6, 7, 8])) | ||
mail.asm = ASM(99, [4, 5, 6, 7, 8]) | ||
|
||
mail.set_ip_pool_name("24") | ||
mail.ip_pool_name = "24" | ||
|
||
mail_settings = MailSettings() | ||
mail_settings.set_bcc_settings(BCCSettings(True, Email("[email protected]"))) | ||
mail_settings.set_bypass_list_management(BypassListManagement(True)) | ||
mail_settings.set_footer_settings(FooterSettings(True, "Footer Text", "<html><body>Footer Text</body></html>")) | ||
mail_settings.set_sandbox_mode(SandBoxMode(True)) | ||
mail_settings.set_spam_check(SpamCheck(True, 1, "https://spamcatcher.sendgrid.com")) | ||
mail.set_mail_settings(mail_settings) | ||
mail_settings.bcc_settings = BCCSettings(True, Email("[email protected]")) | ||
mail_settings.bypass_list_management = BypassListManagement(True) | ||
mail_settings.footer_settings = FooterSettings(True, "Footer Text", "<html><body>Footer Text</body></html>") | ||
mail_settings.sandbox_mode = SandBoxMode(True) | ||
mail_settings.spam_check = SpamCheck(True, 1, "https://spamcatcher.sendgrid.com") | ||
mail.mail_settings = mail_settings | ||
|
||
tracking_settings = TrackingSettings() | ||
tracking_settings.set_click_tracking(ClickTracking(True, True)) | ||
tracking_settings.set_open_tracking(OpenTracking(True, "Optional tag to replace with the open image in the body of the message")) | ||
tracking_settings.set_subscription_tracking(SubscriptionTracking(True, "text to insert into the text/plain portion of the message", "<html><body>html to insert into the text/html portion of the message</body></html>", "Optional tag to replace with the open image in the body of the message")) | ||
tracking_settings.set_ganalytics(Ganalytics(True, "some source", "some medium", "some term", "some_content", "some_campaign")) | ||
mail.set_tracking_settings(tracking_settings) | ||
tracking_settings.click_tracking = ClickTracking(True, True) | ||
tracking_settings.open_tracking = OpenTracking(True, "Optional tag to replace with the open image in the body of the message") | ||
tracking_settings.subscription_tracking = SubscriptionTracking(True, "text to insert into the text/plain portion of the message", "<html><body>html to insert into the text/html portion of the message</body></html>", "Optional tag to replace with the open image in the body of the message") | ||
tracking_settings.ganalytics = Ganalytics(True, "some source", "some medium", "some term", "some_content", "some_campaign") | ||
mail.tracking_settings = tracking_settings | ||
|
||
mail.set_reply_to(Email("[email protected]")) | ||
mail.reply_to = Email("[email protected]") | ||
|
||
return mail.get() | ||
|
||
|
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,2 +1,2 @@ | ||
version_info = (3, 6, 5) | ||
version_info = (4, 0, 0) | ||
__version__ = '.'.join(str(v) for v in version_info) |