From d2224e4819d5746b9fafcb5ad2701aabcbabafdb Mon Sep 17 00:00:00 2001 From: Vinayak <32881538+vinayak42@users.noreply.github.com> Date: Tue, 16 Oct 2018 22:39:07 +0530 Subject: [PATCH 001/237] Updated link to direct to #L9 @misterdorm The link to /mail/send Helper looked fine. Please provide details as to where it should direct to. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4132b62b5..e6901f233 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ pip install sendgrid ## Hello Email -The following is the minimum needed code to send an email with the [/mail/send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) ([here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail_example.py) is a full example): +The following is the minimum needed code to send an email with the [/mail/send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) ([here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail_example.py#L9) is a full example): ### With Mail Helper Class From 610e933b8a829617583bdb5684d799c94020bebf Mon Sep 17 00:00:00 2001 From: Eamonn Nugent Date: Fri, 28 Jun 2019 18:23:31 -0400 Subject: [PATCH 002/237] Handle new API in the helper example (#818) * Fix to handle new API * Make it return the raw Mail object rather than a JSON representation --- examples/helpers/README.md | 4 ++-- examples/helpers/mail_example.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/helpers/README.md b/examples/helpers/README.md index 95981b497..2eebbe421 100644 --- a/examples/helpers/README.md +++ b/examples/helpers/README.md @@ -21,7 +21,7 @@ content = Content("text/plain", "some text here") The `Content` class takes mainly two parameters: MIME type and the actual content of the email, it then returns the JSON-ready representation of this content. ``` - mail = Mail(from_email, subject, to_email, content) + mail = Mail(from_email, to_email, subject, content) ``` After adding the above we create a mail object using `Mail` class, it takes the following parameters: email address to send from, subject line of emails, email address to send to, content of the message. For more information on parameters and usage, see [here](https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/mail.py) @@ -58,7 +58,7 @@ After you have configured every component and added your own functions, you can ``` sg = SendGridAPIClient() data = build_kitchen_sink() - response = sg.client.mail.send.post(request_body=data) + response = sg.send(data) ``` Make sure you have [environment variable](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key) set up! Full example [here](https://github.com/sendgrid/sendgrid-python/blob/0b683169b08d3a7c204107cd333be33053297e74/examples/helpers/mail_example.py#L203). diff --git a/examples/helpers/mail_example.py b/examples/helpers/mail_example.py index 8088426b6..040c990d4 100644 --- a/examples/helpers/mail_example.py +++ b/examples/helpers/mail_example.py @@ -306,7 +306,7 @@ def build_kitchen_sink(): UtmCampaign("utm_campaign")) message.tracking_settings = tracking_settings - return message.get() + return message def send_hello_email(): From 021a9dc7dd2a9be955e50c53bd5fa4c313b11c15 Mon Sep 17 00:00:00 2001 From: Serhiy Zahoriya Date: Wed, 11 Sep 2019 18:47:03 +0300 Subject: [PATCH 003/237] API key permissions mention in USAGE.md (#821) --- USAGE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/USAGE.md b/USAGE.md index 6342c753e..6f79e7f96 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,6 +2,8 @@ This documentation is based on our [OAI specification](https://github.com/sendgr # INITIALIZATION +Make sure your API key has the [required permissions](https://sendgrid.com/docs/ui/account-and-settings/api-keys/). + ```python from sendgrid import SendGridAPIClient import os From f53941f626b6bdb61aed82dfe44d9d4b6a6beb1b Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Thu, 12 Sep 2019 14:31:07 -0700 Subject: [PATCH 004/237] Fix for ganalytics json builder (#839) --- sendgrid/helpers/mail/ganalytics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/ganalytics.py b/sendgrid/helpers/mail/ganalytics.py index f1e88f4b9..5f6327154 100644 --- a/sendgrid/helpers/mail/ganalytics.py +++ b/sendgrid/helpers/mail/ganalytics.py @@ -168,7 +168,7 @@ def get(self): for key in keys: value = getattr(self, key, None) if value is not None: - if isinstance(value, bool): + if isinstance(value, bool) or isinstance(value, str): ganalytics[key] = value else: ganalytics[key] = value.get() From 2c500f41118c6cf75e4692dd0be474595550b61f Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Thu, 12 Sep 2019 14:55:17 -0700 Subject: [PATCH 005/237] Version Bump v6.2.0: dependency update --- CHANGELOG.md | 12 ++++++++++++ docker/README.md | 3 ++- sendgrid/version.py | 2 +- setup.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 755e5f00e..4de97e669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Change Log All notable changes to this project will be documented in this file. +## [6.1.0] - 2019-09-12 ## + +### Added +- Bumped dependency on python-http-client to [v3.2.1](https://github.com/sendgrid/python-http-client/releases/tag/v3.2.0) +- [PR #807](https://github.com/sendgrid/sendgrid-python/pull/807): Get version from version.py instead of version.txt. (BIG thanks to [@lipis](https://github.com/lipis)) +- [PR #808](https://github.com/sendgrid/sendgrid-python/pull/808): API key permissions mention in USAGE.md. (BIG thanks to [@int-ua](https://github.com/int-ua)) + +### Fixed +- [PR #763](https://github.com/sendgrid/sendgrid-python/pull/763): Updated Error Message Section. (BIG thanks to [@FFX01](https://github.com/FFX01)) +- [PR #818](https://github.com/sendgrid/sendgrid-python/pull/818): Handle new API in the helper example. (BIG thanks to [@enugentdt](https://github.com/enugentdt)) +- [PR #839](https://github.com/sendgrid/sendgrid-python/pull/839): Fix for ganalytics json builder. + ## [6.0.5] - 2019-05-01 ## ### Fixed diff --git a/docker/README.md b/docker/README.md index 80001d5ab..0467daf15 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,5 +1,6 @@ # Supported tags and respective `Dockerfile` links - - `v6.0.5`, `latest` [(Dockerfile)](https://github.com/sendgrid/sendgrid-python/blob/master/docker/Dockerfile) + - `v6.1.0`, `latest` [(Dockerfile)](https://github.com/sendgrid/sendgrid-python/blob/master/docker/Dockerfile) + - `v6.0.5` - `v6.0.3` - `v6.0.0` - `v5.6.0` diff --git a/sendgrid/version.py b/sendgrid/version.py index e6b8055a9..44b238fae 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1,2 +1,2 @@ -version_info = (6, 0, 5) +version_info = (6, 1, 0) __version__ = '.'.join(str(v) for v in version_info) diff --git a/setup.py b/setup.py index 77439cac4..de6e0ff5a 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ exec(f.read()) def getRequires(): - deps = ['python_http_client>=3.0'] + deps = ['python_http_client>=3.2.1'] return deps From 6fe402c67aedb45659a44a9fac7beeddb4fd1af3 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Thu, 16 Jan 2020 12:57:29 -0800 Subject: [PATCH 006/237] chore: prep the repo for automated releasing (#862) * chore: prep the repo for automated releasing * chore: drop support for python v3.4 --- .travis.yml | 68 +++++++++++++++---------------------------- CHANGELOG.md | 3 +- LICENSE.txt | 4 ++- Makefile | 18 ++++++++++++ README.rst | 4 +-- requirements.txt | 2 +- sendgrid/version.py | 3 +- setup.py | 2 +- test/test_sendgrid.py | 8 +++-- 9 files changed, 58 insertions(+), 54 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index 872bd38d3..1cd074fb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,9 @@ language: python sudo: false cache: pip python: -- '2.7' -- '3.4' -- '3.5' -- '3.6' + - '2.7' + - '3.5' + - '3.6' # Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs matrix: include: @@ -14,47 +13,28 @@ matrix: sudo: true env: global: - - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN + - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN SENDGRID_API_KEY=SGAPIKEY install: -- python setup.py install -- pip install pyyaml -- pip install flask -- pip install six -- pip install coverage -- pip install codecov -# - sudo apt-get install -y pandoc -addons: - apt_packages: - - pandoc + - python setup.py install + - pip install pyyaml flask six coverage codecov before_script: -- "./test/prism.sh &" -- sleep 20 -- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter -- chmod +x ./cc-test-reporter -- ./cc-test-reporter before-build + - "./test/prism.sh &" + - sleep 20 + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build script: -- coverage run -m unittest discover + - coverage run -m unittest discover after_script: -- codecov -- ./cc-test-reporter after-build --exit-code $? -# deploy: -# provider: pypi -# user: thinkingserious -# password: -# secure: DoM21KiMKkt/7AS6zOqTs7j3fgInrpswRTPG3cqBNRSzyfkXeXmKecCPruooxvYKLM7fPNDOuIH2phgCjdx/XBtJwghNh34n+TzhNFEiI/6pV0iS4a9gW0+QU+GMYvQmfNlA9DKQ5N20FMy4XeK8QQFarJXQwW1/a5wWftbUYvQ= -# skip_cleanup: true -# distributions: sdist bdist_wheel -# on: -# tags: true -# python: '3.6' -notifications: - hipchat: - rooms: - secure: Lo3L/YNWpn9ulGX4D2HlWrBOyxMPlLkFcwxbYViG69Ta6BV+c6YE+Pct43tExlL6sZ+nj5p8X4KRTeOM4sqASrebWA25nyUrNTm+vZYFbi5XfmGvvi8TEsgg0MYRQRWWn/R2z0kZW/fqOY6sqJuoIafMBmC3tayTJRiH1Ct2Cw0= - template: - - '%{repository} - Build %{build_number} on branch %{branch} by %{author}: %{message} - View on - GitHub' - format: html - notify: false + - codecov + - ./cc-test-reporter after-build --exit-code $? +deploy: + provider: pypi + user: __token__ + password: + secure: $PYPI_TOKEN + skip_cleanup: true + distributions: sdist bdist_wheel + on: + tags: true + python: '3.6' diff --git a/CHANGELOG.md b/CHANGELOG.md index 4de97e669..77ef75032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. -## [6.1.0] - 2019-09-12 ## +[2019-09-12] Version 6.1.0 +--------------------------- ### Added - Bumped dependency on python-http-client to [v3.2.1](https://github.com/sendgrid/python-http-client/releases/tag/v3.2.0) diff --git a/LICENSE.txt b/LICENSE.txt index a01fda40a..56fd3ede7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,6 @@ -Copyright (c) 2012-2019 Twilio SendGrid, Inc. +The MIT License (MIT) + +Copyright (c) 2012-2020 Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..b0595125b --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +.PHONY: venv install test-install test clean nopyc + +venv: + @python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1); + virtualenv --python=python venv + +install: venv + . venv/bin/activate; python setup.py install + . venv/bin/activate; pip install -r requirements.txt + +test: + . venv/bin/activate; python -m unittest discover -v + +clean: nopyc + rm -rf venv + +nopyc: + find . -name \*.pyc -delete diff --git a/README.rst b/README.rst index c7c296958..01e5df688 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ .. image:: https://github.com/sendgrid/sendgrid-python/raw/master/twilio_sendgrid_logo.png :target: https://www.sendgrid.com - + |Travis Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| @@ -46,7 +46,7 @@ Installation Prerequisites ------------- -- Python version 2.7 and 3.4+ +- Python version 2.7 and 3.5+ - For email, you will need a Twilio SendGrid account, starting at the `free level`_ - For SMS messages, you will need a free `Twilio account`_ diff --git a/requirements.txt b/requirements.txt index 6ec05dd87..ce29b7f3e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Flask==1.0.2 PyYAML>=4.2b1 -python-http-client==3.1.0 +python-http-client>=3.2.1 six==1.11.0 pytest==3.8.2 diff --git a/sendgrid/version.py b/sendgrid/version.py index 44b238fae..9f62d7687 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1,2 +1 @@ -version_info = (6, 1, 0) -__version__ = '.'.join(str(v) for v in version_info) +__version__ = '6.1.0' diff --git a/setup.py b/setup.py index de6e0ff5a..a2b57099f 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def getRequires(): description='Twilio SendGrid library for Python', long_description=readme, install_requires=getRequires(), - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', classifiers=[ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index 88c321c9b..15063e088 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -863,7 +863,7 @@ def test_ips_get(self): data = response.body unused = unassigned(data) self.assertEqual(type(unused), list) - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 200) def test_ips_assigned_get(self): headers = {'X-Mock': 200} @@ -2305,8 +2305,12 @@ def test_whitelabel_links__link_id__subuser_post(self): def test_license_year(self): LICENSE_FILE = 'LICENSE.txt' + copyright_line='' with open(LICENSE_FILE, 'r') as f: - copyright_line = f.readline().rstrip() + for line in f: + if line.startswith('Copyright'): + copyright_line = line.strip() + break self.assertEqual( 'Copyright (c) 2012-%s Twilio SendGrid, Inc.' % datetime.datetime.now().year, copyright_line) From bffb267bf222a2c6b61e345f3e456ff5f68640b4 Mon Sep 17 00:00:00 2001 From: Romain Date: Thu, 16 Jan 2020 23:20:50 +0000 Subject: [PATCH 007/237] clean up imports (#853) --- use_cases/attachment.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/use_cases/attachment.md b/use_cases/attachment.md index f71fed3a8..8ec7565dc 100644 --- a/use_cases/attachment.md +++ b/use_cases/attachment.md @@ -3,22 +3,10 @@ ```python import base64 import os -import json -from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import ( Mail, Attachment, FileContent, FileName, FileType, Disposition, ContentId) -try: - # Python 3 - import urllib.request as urllib -except ImportError: - # Python 2 - import urllib2 as urllib - -import os -import json from sendgrid import SendGridAPIClient -from sendgrid.helpers.mail import Mail message = Mail( from_email='from_email@example.com', @@ -46,4 +34,4 @@ try: except Exception as e: print(e.message) -``` \ No newline at end of file +``` From 04a06d80bcb37b3b607729041d350efc7f2bbb70 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Thu, 16 Jan 2020 15:31:25 -0800 Subject: [PATCH 008/237] fix: improve make test command (#863) * fix: improve make test testing --- .travis.yml | 8 ++++---- Makefile | 7 ++++++- test/requirements.txt | 6 ++++++ 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 test/requirements.txt diff --git a/.travis.yml b/.travis.yml index 1cd074fb1..6d42ff9ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ env: global: - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN SENDGRID_API_KEY=SGAPIKEY install: - - python setup.py install - - pip install pyyaml flask six coverage codecov + - make install + - make test-install before_script: - "./test/prism.sh &" - sleep 20 @@ -24,9 +24,9 @@ before_script: - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - - coverage run -m unittest discover + - . venv/bin/activate; coverage run -m unittest discover after_script: - - codecov + - . venv/bin/activate; codecov - ./cc-test-reporter after-build --exit-code $? deploy: provider: pypi diff --git a/Makefile b/Makefile index b0595125b..0e275b62b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,12 @@ install: venv . venv/bin/activate; python setup.py install . venv/bin/activate; pip install -r requirements.txt -test: +test-install: + . venv/bin/activate; pip install -r test/requirements.txt + +test: test-install + ./test/prism.sh & + sleep 2 . venv/bin/activate; python -m unittest discover -v clean: nopyc diff --git a/test/requirements.txt b/test/requirements.txt new file mode 100644 index 000000000..6cb2e96d2 --- /dev/null +++ b/test/requirements.txt @@ -0,0 +1,6 @@ +pyyaml +flask +six +coverage +codecov +mock From 66f23b2a410aa7df24c475a8757fd4ee6a2c3819 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 17 Jan 2020 16:10:52 -0600 Subject: [PATCH 009/237] docs: baseline all the templated markdown docs (#865) --- .github/ISSUE_TEMPLATE | 17 ------- .github/PULL_REQUEST_TEMPLATE | 25 ---------- CODE_OF_CONDUCT.md | 93 ++++++++++++++++++++++++----------- CONTRIBUTING.md | 2 +- ISSUE_TEMPLATE.md | 26 ++++++++++ LICENSE.md | 21 ++++++++ LICENSE.txt | 17 ------- MANIFEST.in | 2 +- PULL_REQUEST_TEMPLATE.md | 31 ++++++++++++ README.rst | 4 +- test/test_project.py | 10 ++-- test/test_sendgrid.py | 4 +- 12 files changed, 153 insertions(+), 99 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE delete mode 100644 .github/PULL_REQUEST_TEMPLATE create mode 100644 ISSUE_TEMPLATE.md create mode 100644 LICENSE.md delete mode 100644 LICENSE.txt create mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE deleted file mode 100644 index 1ac1c9968..000000000 --- a/.github/ISSUE_TEMPLATE +++ /dev/null @@ -1,17 +0,0 @@ -#### Issue Summary - -A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, code examples. - - -#### Steps to Reproduce - -1. This is the first step -2. This is the second step -3. Further steps, etc. - -Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead? - -#### Technical details: - -* sendgrid-python Version: master (latest commit: [commit number]) -* Python Version: X.X \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE deleted file mode 100644 index caf28d9da..000000000 --- a/.github/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,25 +0,0 @@ - -# Fixes #X - -### Checklist -- [ ] I acknowledge that all my contributions will be made under the project's license -- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) -- [ ] I have read the [Contribution Guide] and my PR follows them -- [ ] I updated my branch with the master branch -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] I have added necessary documentation about the functionality in the appropriate .md file -- [ ] I have added in line documentation to the code I modified - -### Short description of what this PR does: -- - -If you have questions, please send an email to [Twilio SendGrid](mailto:dx@sendgrid.com), or file a GitHub Issue in this repository. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 52e42a1e1..2f0727ed5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,38 +1,73 @@ -# Twilio SendGrid Community Code of Conduct - - The Twilio SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community. - - ### Be Open - Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference. +# Contributor Covenant Code of Conduct - ### Be Considerate - Members of the community are considerate of their peers, which include other contributors and users of Twilio SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views. +## Our Pledge - ### Be Respectful - Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments, and their efforts. We're respectful of the volunteer efforts that permeate the Twilio SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good with each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. - ## Additional Guidance +## Our Standards - ### Disclose Potential Conflicts of Interest - Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another. +Examples of behavior that contributes to creating a positive environment +include: - ### Interpretation - This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [Twilio SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest. - - ### Enforcement - Most members of the Twilio SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors. +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members - ## If you have concerns about someone’s conduct - **Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code. +Examples of unacceptable behavior by participants include: - **Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first. +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting - **Contact the Moderators** - You can reach the Twilio SendGrid moderators by emailing dx@sendgrid.com. - - ## Attribution +## Our Responsibilities - Twilio SendGrid thanks the following, on which it draws for content and inspiration: - -* [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct) -* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct) -* [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html) +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at open-source@twilio.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f9444912..1c931fab1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ Before you decide to create a new issue, please try the following: ### Please use our Bug Report Template -In order to make the process easier, we've included a [sample bug report template]((https://github.com/sendgrid/sendgrid-python/.github/ISSUE_TEMPLATE)) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. +In order to make the process easier, we've included a [sample bug report template]((https://github.com/sendgrid/sendgrid-python/ISSUE_TEMPLATE.md)) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. ## Improvements to the Codebase diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..a4b1cc240 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,26 @@ + + +### Issue Summary +A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples. + +### Steps to Reproduce +1. This is the first step +2. This is the second step +3. Further steps, etc. + +### Code Snippet +```python +# paste code here +``` + +### Exception/Log +``` +# paste exception/log here +``` + +### Technical details: +* sendgrid-python version: +* python version: + diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..29aba592a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2020, Twilio SendGrid, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 56fd3ede7..000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,17 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012-2020 Twilio SendGrid, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of -the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in index 594e724b7..f2ec0f7aa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include README.rst -include LICENSE.txt +include LICENSE.md include app.json include Procfile include requirements.txt diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..215059a96 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,31 @@ + + +# Fixes # + +A short description of what this PR does. + +### Checklist +- [ ] I acknowledge that all my contributions will be made under the project's license +- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) +- [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them +- [ ] I have titled the PR appropriately +- [ ] I have updated my branch with the master branch +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added necessary documentation about the functionality in the appropriate .md file +- [ ] I have added inline documentation to the code I modified + +If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. diff --git a/README.rst b/README.rst index 01e5df688..7d78db946 100644 --- a/README.rst +++ b/README.rst @@ -303,7 +303,7 @@ License .. _Sign the CLA to Create a Pull Request: https://cla.sendgrid.com/sendgrid/sendgrid-python .. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md .. _Developer Experience Team: mailto:dx@sendgrid.com -.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/master/LICENSE.txt +.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/master/LICENSE.md .. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master :target: https://travis-ci.org/sendgrid/sendgrid-python @@ -318,7 +318,7 @@ License .. |Email Notifications Badge| image:: https://dx.sendgrid.com/badge/python :target: https://dx.sendgrid.com/newsletter/python .. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg - :target: ./LICENSE.txt + :target: ./LICENSE.md .. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow :target: https://twitter.com/sendgrid .. |GitHub contributors| image:: https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg diff --git a/test/test_project.py b/test/test_project.py index 680898f04..27d0befb9 100644 --- a/test/test_project.py +++ b/test/test_project.py @@ -40,17 +40,17 @@ def test_code_of_conduct(self): def test_contributing(self): self.assertTrue(os.path.isfile('./CONTRIBUTING.md')) - # ./.github/ISSUE_TEMPLATE + # ./ISSUE_TEMPLATE.md def test_issue_template(self): - self.assertTrue(os.path.isfile('./.github/ISSUE_TEMPLATE')) + self.assertTrue(os.path.isfile('./ISSUE_TEMPLATE.md')) # ./LICENSE.md def test_license(self): - self.assertTrue(os.path.isfile('./LICENSE.txt')) + self.assertTrue(os.path.isfile('./LICENSE.md')) - # ./.github/PULL_REQUEST_TEMPLATE + # ./PULL_REQUEST_TEMPLATE.md def test_pr_template(self): - self.assertTrue(os.path.isfile('./.github/PULL_REQUEST_TEMPLATE')) + self.assertTrue(os.path.isfile('./PULL_REQUEST_TEMPLATE.md')) # ./README.rst def test_readme(self): diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index 15063e088..29f40924e 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -2304,7 +2304,7 @@ def test_whitelabel_links__link_id__subuser_post(self): self.assertEqual(response.status_code, 200) def test_license_year(self): - LICENSE_FILE = 'LICENSE.txt' + LICENSE_FILE = 'LICENSE.md' copyright_line='' with open(LICENSE_FILE, 'r') as f: for line in f: @@ -2312,7 +2312,7 @@ def test_license_year(self): copyright_line = line.strip() break self.assertEqual( - 'Copyright (c) 2012-%s Twilio SendGrid, Inc.' % datetime.datetime.now().year, + 'Copyright (C) %s, Twilio SendGrid, Inc. ' % datetime.datetime.now().year, copyright_line) # @classmethod From 9e94def93cc60aea6d9a592c382aa65fcde0625f Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 24 Jan 2020 07:26:14 +0000 Subject: [PATCH 010/237] [Librarian] Version Bump --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77ef75032..088b20f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-01-24] Version 6.1.1 +-------------------------- +**Library - Docs** +- [PR #865](https://github.com/sendgrid/sendgrid-python/pull/865): baseline all the templated markdown docs. Thanks to [@childish-sambino](https://github.com/childish-sambino)! + +**Library - Chore** +- [PR #853](https://github.com/sendgrid/sendgrid-python/pull/853): clean up imports. Thanks to [@DucarrougeR](https://github.com/DucarrougeR)! +- [PR #862](https://github.com/sendgrid/sendgrid-python/pull/862): prep the repo for automated releasing. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + +**Library - Fix** +- [PR #863](https://github.com/sendgrid/sendgrid-python/pull/863): improve make test command. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2019-09-12] Version 6.1.0 --------------------------- From 71c6802f66df62e32f0305bb1ebf0a60f6716e52 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 24 Jan 2020 07:28:19 +0000 Subject: [PATCH 011/237] Release 6.1.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 9f62d7687..cf37bf506 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.1.0' +__version__ = '6.1.1' From 076f3767c15ebba1f28de3c4c249248d9fa25bce Mon Sep 17 00:00:00 2001 From: Phawin Khongkhasawan Date: Wed, 19 Feb 2020 20:47:35 +0700 Subject: [PATCH 012/237] Convert integer substitution value to string (#838) --- sendgrid/helpers/mail/substitution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/substitution.py b/sendgrid/helpers/mail/substitution.py index d0e59837e..d515e885b 100644 --- a/sendgrid/helpers/mail/substitution.py +++ b/sendgrid/helpers/mail/substitution.py @@ -48,7 +48,7 @@ def value(self): :rtype value: string """ - return self._value + return str(self._value) if isinstance(self._value, int) else self._value @value.setter def value(self, value): From fdc3b69e55e778bf39a5a6056cf5a785805eb836 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 19 Feb 2020 23:47:58 +0000 Subject: [PATCH 013/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 088b20f2b..17c66d8a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-02-19] Version 6.1.2 +-------------------------- +**Library - Fix** +- [PR #838](https://github.com/sendgrid/sendgrid-python/pull/838): Convert integer substitution value to string. Thanks to [@lifez](https://github.com/lifez)! + + [2020-01-24] Version 6.1.1 -------------------------- **Library - Docs** From 06b9a0ce113018d95a11778bece81a9420d07561 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 20 Feb 2020 00:06:41 +0000 Subject: [PATCH 014/237] Release 6.1.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index cf37bf506..3bdb88685 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.1.1' +__version__ = '6.1.2' From 5f251e868ca932fd28f8900b2f600ae0c9e6a42d Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 21 Feb 2020 11:29:45 -0600 Subject: [PATCH 015/237] chore: add Python 3.8 to Travis (#870) --- .travis.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d42ff9ea..a2a133692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,12 @@ +dist: xenial # required for Python >= 3.7 language: python -sudo: false cache: pip python: - '2.7' - '3.5' - '3.6' -# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs -matrix: - include: - - python: 3.7 - dist: xenial - sudo: true + - '3.7' + - '3.8' env: global: - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN SENDGRID_API_KEY=SGAPIKEY From 83e25d3c366da6c12fcdaef2b5e46b38d89a7228 Mon Sep 17 00:00:00 2001 From: Aman Mehta Date: Wed, 26 Feb 2020 20:48:17 +0530 Subject: [PATCH 016/237] chore: Clean up sendgrid.py (#844) --- sendgrid/sendgrid.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sendgrid/sendgrid.py b/sendgrid/sendgrid.py index d2450522a..bc1454d28 100644 --- a/sendgrid/sendgrid.py +++ b/sendgrid/sendgrid.py @@ -1,6 +1,5 @@ """ -This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via -Python. +This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python. For more information on this library, see the README on GitHub. http://github.com/sendgrid/sendgrid-python @@ -12,9 +11,7 @@ This file provides the Twilio SendGrid API Client. """ - import os -import warnings import python_http_client From b6cca1c054c3bf77d4fbfd9cd8570c555c73c0bf Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Wed, 26 Feb 2020 11:48:59 -0800 Subject: [PATCH 017/237] fix: add config.yml file to pypi distribution files (#872) --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index f2ec0f7aa..cd3c5f680 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,5 +3,6 @@ include LICENSE.md include app.json include Procfile include requirements.txt +include sendgrid/helpers/inbound/config.yml recursive-include sendgrid *.py *.txt recursive-exclude test * From 9aa75b1e69c4bf2b63964eb5797a22d3949b9dc3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 4 Mar 2020 21:20:19 +0000 Subject: [PATCH 018/237] [Librarian] Version Bump --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17c66d8a2..a5311e421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-03-04] Version 6.1.3 +-------------------------- +**Library - Chore** +- [PR #844](https://github.com/sendgrid/sendgrid-python/pull/844): Clean up sendgrid.py. Thanks to [@Aman-am](https://github.com/Aman-am)! +- [PR #870](https://github.com/sendgrid/sendgrid-python/pull/870): add Python 3.8 to Travis. Thanks to [@childish-sambino](https://github.com/childish-sambino)! + +**Library - Fix** +- [PR #872](https://github.com/sendgrid/sendgrid-python/pull/872): add config.yml file to pypi distribution files. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2020-02-19] Version 6.1.2 -------------------------- **Library - Fix** From 267b3477f86cd995c094bdd7d95bc83f72af2b1b Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 4 Mar 2020 21:57:31 +0000 Subject: [PATCH 019/237] Release 6.1.3 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 3bdb88685..00957ae80 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.1.2' +__version__ = '6.1.3' From 1abbf5859bd1f7116cc807575c862f7bf907986e Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Thu, 5 Mar 2020 10:18:01 -0800 Subject: [PATCH 020/237] fix: travis autodeploy and Release 6.1.3 --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2a133692..21ecfff65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,8 @@ after_script: - ./cc-test-reporter after-build --exit-code $? deploy: provider: pypi - user: __token__ - password: - secure: $PYPI_TOKEN + user: "__token__" + password: $PYPI_TOKEN skip_cleanup: true distributions: sdist bdist_wheel on: From 0bc6ad89c39159ecdbd2be32298fe45792ae6995 Mon Sep 17 00:00:00 2001 From: gy741 Date: Sat, 7 Mar 2020 04:11:31 +0900 Subject: [PATCH 021/237] chore: Remove unused Python json modules (#731) --- examples/accesssettings/accesssettings.py | 1 - examples/alerts/alerts.py | 1 - examples/apikeys/apikeys.py | 1 - examples/asm/asm.py | 1 - examples/browsers/browsers.py | 1 - examples/campaigns/campaigns.py | 1 - examples/categories/categories.py | 1 - examples/clients/clients.py | 1 - examples/contactdb/contactdb.py | 1 - examples/devices/devices.py | 1 - examples/geo/geo.py | 1 - examples/ips/ips.py | 1 - examples/mail/mail.py | 1 - examples/mailboxproviders/mailboxproviders.py | 1 - examples/mailsettings/mailsettings.py | 1 - examples/partnersettings/partnersettings.py | 1 - examples/scopes/scopes.py | 1 - examples/senders/senders.py | 1 - examples/stats/stats.py | 1 - examples/subusers/subusers.py | 1 - examples/suppression/suppression.py | 1 - examples/templates/templates.py | 1 - examples/trackingsettings/trackingsettings.py | 1 - examples/user/user.py | 1 - 24 files changed, 24 deletions(-) diff --git a/examples/accesssettings/accesssettings.py b/examples/accesssettings/accesssettings.py index 1c8995299..17d115f9b 100644 --- a/examples/accesssettings/accesssettings.py +++ b/examples/accesssettings/accesssettings.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/alerts/alerts.py b/examples/alerts/alerts.py index bbc75e69c..cdfe008fd 100644 --- a/examples/alerts/alerts.py +++ b/examples/alerts/alerts.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/apikeys/apikeys.py b/examples/apikeys/apikeys.py index cfb92aba8..3e612cb15 100644 --- a/examples/apikeys/apikeys.py +++ b/examples/apikeys/apikeys.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/asm/asm.py b/examples/asm/asm.py index d7b9a94d2..1b081b851 100644 --- a/examples/asm/asm.py +++ b/examples/asm/asm.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/browsers/browsers.py b/examples/browsers/browsers.py index f88493416..43152260a 100644 --- a/examples/browsers/browsers.py +++ b/examples/browsers/browsers.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/campaigns/campaigns.py b/examples/campaigns/campaigns.py index 59ade9794..dbbb6c0e1 100644 --- a/examples/campaigns/campaigns.py +++ b/examples/campaigns/campaigns.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/categories/categories.py b/examples/categories/categories.py index 9f2b98486..b8275713f 100644 --- a/examples/categories/categories.py +++ b/examples/categories/categories.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/clients/clients.py b/examples/clients/clients.py index 847c8df37..023a440db 100644 --- a/examples/clients/clients.py +++ b/examples/clients/clients.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/contactdb/contactdb.py b/examples/contactdb/contactdb.py index 76fcada3c..b702974df 100644 --- a/examples/contactdb/contactdb.py +++ b/examples/contactdb/contactdb.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/devices/devices.py b/examples/devices/devices.py index fe9fcd28e..50c96243d 100644 --- a/examples/devices/devices.py +++ b/examples/devices/devices.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/geo/geo.py b/examples/geo/geo.py index ed2ea8cb1..64265b201 100644 --- a/examples/geo/geo.py +++ b/examples/geo/geo.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/ips/ips.py b/examples/ips/ips.py index f3cfec282..316d0c858 100644 --- a/examples/ips/ips.py +++ b/examples/ips/ips.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/mail/mail.py b/examples/mail/mail.py index 9584edc59..d59901d1d 100644 --- a/examples/mail/mail.py +++ b/examples/mail/mail.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/mailboxproviders/mailboxproviders.py b/examples/mailboxproviders/mailboxproviders.py index dcd3d1e1d..4fbf470e2 100644 --- a/examples/mailboxproviders/mailboxproviders.py +++ b/examples/mailboxproviders/mailboxproviders.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/mailsettings/mailsettings.py b/examples/mailsettings/mailsettings.py index 47ce6e1db..a4d46e399 100644 --- a/examples/mailsettings/mailsettings.py +++ b/examples/mailsettings/mailsettings.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/partnersettings/partnersettings.py b/examples/partnersettings/partnersettings.py index 4eef00b12..d3675a6ba 100644 --- a/examples/partnersettings/partnersettings.py +++ b/examples/partnersettings/partnersettings.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/scopes/scopes.py b/examples/scopes/scopes.py index 369b9a519..99519dc3e 100644 --- a/examples/scopes/scopes.py +++ b/examples/scopes/scopes.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/senders/senders.py b/examples/senders/senders.py index e8aeb2ea3..55eb44631 100644 --- a/examples/senders/senders.py +++ b/examples/senders/senders.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/stats/stats.py b/examples/stats/stats.py index 56cc9fadb..cde422447 100644 --- a/examples/stats/stats.py +++ b/examples/stats/stats.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/subusers/subusers.py b/examples/subusers/subusers.py index f6a28f9d6..0f5ba6fe0 100644 --- a/examples/subusers/subusers.py +++ b/examples/subusers/subusers.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/suppression/suppression.py b/examples/suppression/suppression.py index e235f8f92..430f76f35 100644 --- a/examples/suppression/suppression.py +++ b/examples/suppression/suppression.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/templates/templates.py b/examples/templates/templates.py index c5293b9c2..9b5210191 100644 --- a/examples/templates/templates.py +++ b/examples/templates/templates.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/trackingsettings/trackingsettings.py b/examples/trackingsettings/trackingsettings.py index cfde91e96..b3c49f8b2 100644 --- a/examples/trackingsettings/trackingsettings.py +++ b/examples/trackingsettings/trackingsettings.py @@ -1,5 +1,4 @@ import sendgrid -import json import os diff --git a/examples/user/user.py b/examples/user/user.py index bca521d41..5160f9ff8 100644 --- a/examples/user/user.py +++ b/examples/user/user.py @@ -1,5 +1,4 @@ import sendgrid -import json import os From 499c5f1e1271555f98e91ce96dfad92d46586567 Mon Sep 17 00:00:00 2001 From: Vinayak <32881538+vinayak42@users.noreply.github.com> Date: Sat, 7 Mar 2020 00:53:39 +0530 Subject: [PATCH 022/237] docs: Fix grammatical errors (#706) --- examples/helpers/stats/stats_example.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/helpers/stats/stats_example.py b/examples/helpers/stats/stats_example.py index ba8c94a1a..ebe24f69f 100644 --- a/examples/helpers/stats/stats_example.py +++ b/examples/helpers/stats/stats_example.py @@ -3,10 +3,10 @@ from sendgrid.helpers.stats import * from sendgrid import * -# NOTE: you will need move this file to the root directory of this project to execute properly. +# NOTE: you will need to move this file to the root directory of this project to execute properly. # Assumes you set your environment variable: -# https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key +# See: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) From a8c51126c871950c237bae69c852471ef37a55af Mon Sep 17 00:00:00 2001 From: pktrieu Date: Fri, 6 Mar 2020 11:35:18 -0800 Subject: [PATCH 023/237] docs: Fixed links in examples (#669) --- sendgrid/helpers/mail/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/README.md b/sendgrid/helpers/mail/README.md index 92569275b..29e21dea5 100644 --- a/sendgrid/helpers/mail/README.md +++ b/sendgrid/helpers/mail/README.md @@ -7,4 +7,4 @@ Please complete the [installation steps](https://github.com/sendgrid/sendgrid-py ## Usage - For the most common use cases, please see [these examples](https://github.com/sendgrid/sendgrid-python/tree/master/use_cases) --The comple v3 API Documentation can be found [here](https://sendgrid.com/docs/API_Reference/api_v3.html) +- The complete v3 API Documentation can be found [here](https://sendgrid.com/docs/API_Reference/api_v3.html) From ea90f7c40fd28c473dcfef78cd043bd049afcd9f Mon Sep 17 00:00:00 2001 From: Rounak Agarwal Date: Sat, 7 Mar 2020 01:46:49 +0530 Subject: [PATCH 024/237] docs: Give preference to 'to' after visible (#714) --- USAGE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/USAGE.md b/USAGE.md index 6f79e7f96..343cb8f90 100644 --- a/USAGE.md +++ b/USAGE.md @@ -438,7 +438,7 @@ print(response.headers) Suppression groups, or unsubscribe groups, are specific types or categories of emails that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. -The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. +The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions. Each user can create up to 25 different suppression groups. @@ -482,7 +482,7 @@ print(response.headers) Suppression groups, or unsubscribe groups, are specific types or categories of emails that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. -The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. +The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions. Each user can create up to 25 different suppression groups. @@ -507,7 +507,7 @@ print(response.headers) Suppression groups, or unsubscribe groups, are specific types or categories of emails that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. -The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. +The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions. Each user can create up to 25 different suppression groups. @@ -529,7 +529,7 @@ You can only delete groups that have not been attached to sent mail in the last Suppression groups, or unsubscribe groups, are specific types or categories of emails that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. -The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. +The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions. Each user can create up to 25 different suppression groups. From b2ca1f4b9dfa32ad7ff829c52d0a5efd9128a2f3 Mon Sep 17 00:00:00 2001 From: mcintyre94 Date: Fri, 6 Mar 2020 20:28:42 +0000 Subject: [PATCH 025/237] feat: Add equality to Email (#739) Email objects are defined as equal iff they have the same email and the same name. This is useful for unit tests where we want to verify that the Email objects generated are as expected. --- sendgrid/helpers/mail/email.py | 21 +++++++++++++++ test/test_email.py | 48 ++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/sendgrid/helpers/mail/email.py b/sendgrid/helpers/mail/email.py index 3c2cb3bbb..10a8718b1 100644 --- a/sendgrid/helpers/mail/email.py +++ b/sendgrid/helpers/mail/email.py @@ -73,6 +73,27 @@ def __init__(self, if p is not None: self.personalization = p + def __eq__(self, other): + """Email objects are equal if they have the same email and the same name + + :param other: object to compare with + :type other: any + """ + if isinstance(other, Email): + return self.email == other.email and self.name == other.name + return NotImplemented + + def __ne__(self, other): + """Inverse of __eq__ (required for Python 2) + + :param other: object to compare with + :type other: any + """ + x = self.__eq__(other) + if x is not NotImplemented: + return not x + return NotImplemented + @property def name(self): """Name associated with this email. diff --git a/test/test_email.py b/test/test_email.py index eb50374aa..c8614fe17 100644 --- a/test/test_email.py +++ b/test/test_email.py @@ -80,3 +80,51 @@ def test_add_unicode_name_with_comma(self): email.name = name self.assertEqual(email.name, u'"' + name + u'"') + + def test_equality_email_name(self): + address = "test@example.com" + name = "SomeName" + email1 = Email(address, name) + email2 = Email(address, name) + + self.assertEqual(email1, email2) + + def test_equality_email(self): + address = "test@example.com" + email1 = Email(address) + email2 = Email(address) + + self.assertEqual(email1, email2) + + def test_equality_name(self): + name = "SomeName" + email1 = Email() + email1.name = name + email2 = Email() + email2.name = name + + self.assertEqual(email1, email2) + + def test_equality_different_emails(self): + address1 = "test1@example.com" + email1 = Email(address1) + address2 = "test2@example.com" + email2 = Email(address2) + + self.assertNotEqual(email1, email2) + + def test_equality_different_name(self): + name1 = "SomeName1" + email1 = Email() + email1.name = name1 + name2 = "SomeName2" + email2 = Email() + email2.name = name2 + + self.assertNotEqual(email1, email2) + + def test_equality_non_email(self): + address = "test@example.com" + email = Email(address) + + self.assertNotEqual(email, address) From c114681c003bac6334c59e284122b13c09ae5b54 Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Fri, 6 Mar 2020 15:41:36 -0500 Subject: [PATCH 026/237] docs: Remove more references to 'whitelabel' (#734) --- USAGE.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/USAGE.md b/USAGE.md index 343cb8f90..560daea71 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1822,7 +1822,7 @@ print(response.headers) IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -1844,7 +1844,7 @@ print(response.headers) IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -1863,7 +1863,7 @@ print(response.headers) IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -1886,7 +1886,7 @@ print(response.headers) IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -1906,7 +1906,7 @@ print(response.headers) IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -2728,7 +2728,7 @@ print(response.headers) *You may create up to 100 unique sender identities.* -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. ### POST /senders @@ -2760,7 +2760,7 @@ print(response.headers) **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### GET /senders @@ -2775,7 +2775,7 @@ print(response.headers) **This endpoint allows you to update a sender identity.** -Updates to `from.email` require re-verification. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. +Updates to `from.email` require re-verification. If your domain has been authenticated it will auto verify on creation. Otherwise an email will be sent to the `from.email`. Partial updates are allowed, but fields that are marked as "required" in the POST (create) endpoint must not be nil if that field is included in the PATCH request. @@ -2810,7 +2810,7 @@ print(response.headers) **This endpoint allows you to retrieve a specific sender identity.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### GET /senders/{sender_id} @@ -2826,7 +2826,7 @@ print(response.headers) **This endpoint allows you to delete one of your sender identities.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### DELETE /senders/{sender_id} @@ -2842,7 +2842,7 @@ print(response.headers) **This endpoint allows you to resend a sender identity verification email.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### POST /senders/{sender_id}/resend_verification From a81abdd370ddfcba02d1a5f24fa73ceca29810dc Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 6 Mar 2020 15:04:40 -0600 Subject: [PATCH 027/237] Update send_a_single_email_to_a_single_recipient.md --- use_cases/send_a_single_email_to_a_single_recipient.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/use_cases/send_a_single_email_to_a_single_recipient.md b/use_cases/send_a_single_email_to_a_single_recipient.md index cfd7f532b..8a2364285 100644 --- a/use_cases/send_a_single_email_to_a_single_recipient.md +++ b/use_cases/send_a_single_email_to_a_single_recipient.md @@ -15,5 +15,5 @@ try: print(response.body) print(response.headers) except Exception as e: - print(e.message) -``` \ No newline at end of file + print(e) +``` From 8a53dc99bd7d854bd8c96503cc8de8dfee339081 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Wed, 11 Mar 2020 15:15:48 -0500 Subject: [PATCH 028/237] docs: correct the API key param name --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e6901f233..ff8bd877f 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ import sendgrid import os from sendgrid.helpers.mail import * -sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) +sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) from_email = Email("test@example.com") to_email = Email("test@example.com") subject = "Sending with SendGrid is Fun" @@ -115,7 +115,7 @@ The following is the minimum needed code to send an email without the /mail/send import sendgrid import os -sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) +sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) data = { "personalizations": [ { @@ -149,7 +149,7 @@ print(response.headers) import sendgrid import os -sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) +sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) response = sg.client.suppression.bounces.get() print(response.status_code) print(response.body) @@ -162,7 +162,7 @@ print(response.headers) import sendgrid import os -sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) +sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) response = sg.client._("suppression/bounces").get() print(response.status_code) print(response.body) From 197b61807190b5cbc799ef852eb781192ac2c5cd Mon Sep 17 00:00:00 2001 From: Neeraj Date: Fri, 13 Mar 2020 21:33:38 +0530 Subject: [PATCH 029/237] docs: fix code snippet in README (#878) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff8bd877f..65078707f 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,10 @@ from sendgrid.helpers.mail import * sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) from_email = Email("test@example.com") -to_email = Email("test@example.com") +to_email = To("test@example.com") subject = "Sending with SendGrid is Fun" content = Content("text/plain", "and easy to do anywhere, even with Python") -mail = Mail(from_email, subject, to_email, content) +mail = Mail(from_email, to_email, subject, content) response = sg.client.mail.send.post(request_body=mail.get()) print(response.status_code) print(response.body) From 63f4370b2f3016129bd15cb540e157f945f95a82 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 18 Mar 2020 19:00:28 +0000 Subject: [PATCH 030/237] [Librarian] Version Bump --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5311e421..a749f4e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,23 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-03-18] Version 6.2.0 +-------------------------- +**Library - Docs** +- [PR #878](https://github.com/sendgrid/sendgrid-python/pull/878): fix code snippet in README. Thanks to [@neerajgupta2407](https://github.com/neerajgupta2407)! +- [PR #734](https://github.com/sendgrid/sendgrid-python/pull/734): Further Remove "Whitelabel" References. Thanks to [@crweiner](https://github.com/crweiner)! +- [PR #714](https://github.com/sendgrid/sendgrid-python/pull/714): Give preference to 'to' after visible. Thanks to [@agarwalrounak](https://github.com/agarwalrounak)! +- [PR #669](https://github.com/sendgrid/sendgrid-python/pull/669): Fixed links in examples. Thanks to [@pktrieu](https://github.com/pktrieu)! +- [PR #706](https://github.com/sendgrid/sendgrid-python/pull/706): Fix grammatical errors. Thanks to [@vinayak42](https://github.com/vinayak42)! +- [PR #682](https://github.com/sendgrid/sendgrid-python/pull/682): Updated link to direct to #L9. Thanks to [@vinayak42](https://github.com/vinayak42)! + +**Library - Feature** +- [PR #739](https://github.com/sendgrid/sendgrid-python/pull/739): Add equality to Email. Thanks to [@mcintyre94](https://github.com/mcintyre94)! + +**Library - Chore** +- [PR #731](https://github.com/sendgrid/sendgrid-python/pull/731): Remove unused Python json modules. Thanks to [@gy741](https://github.com/gy741)! + + [2020-03-04] Version 6.1.3 -------------------------- **Library - Chore** From 6a2eced0f441d500b24e2f3b98b93c3e88015255 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 18 Mar 2020 19:32:27 +0000 Subject: [PATCH 031/237] Release 6.2.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 00957ae80..e7c2779ad 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.1.3' +__version__ = '6.2.0' From 40dcb1ed66860d671d001d57e326308a252b67f7 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 31 Mar 2020 10:08:31 -0500 Subject: [PATCH 032/237] docs: support verbiage for login issues (#880) Added support verbiage for login issues due to several recent github issues being opened. --- TROUBLESHOOTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index a5640d10a..f3a64ec3c 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -1,3 +1,5 @@ +If you have an issue logging into your Twilio SendGrid account, please read this [document](https://sendgrid.com/docs/ui/account-and-settings/troubleshooting-login/). For any questions regarding login issues, please contact our [support team](https://support.sendgrid.com). + If you have a non-library Twilio SendGrid issue, please contact our [support team](https://support.sendgrid.com). If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-python/issues). From fcfe96dd3e749c6cdb13ff8d30d5b2bb834f9e87 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 1 Apr 2020 19:04:50 +0000 Subject: [PATCH 033/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a749f4e5a..eada85ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-04-01] Version 6.2.1 +-------------------------- +**Library - Docs** +- [PR #880](https://github.com/sendgrid/sendgrid-python/pull/880): support verbiage for login issues. Thanks to [@adamchasetaylor](https://github.com/adamchasetaylor)! + + [2020-03-18] Version 6.2.0 -------------------------- **Library - Docs** From f5a0dc788489fac1f70d9bb7d74bb4c21b729b8a Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 1 Apr 2020 19:40:17 +0000 Subject: [PATCH 034/237] Release 6.2.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index e7c2779ad..b133e0c3f 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.2.0' +__version__ = '6.2.1' From 1ff5de6b6ae2ab25a20bb37dd0321d90da9578a0 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 3 Apr 2020 13:49:32 -0500 Subject: [PATCH 035/237] fix: correct the User-Agent casing (#881) --- sendgrid/sendgrid.py | 192 +++++++++++++++++++++--------------------- test/test_sendgrid.py | 4 +- 2 files changed, 98 insertions(+), 98 deletions(-) diff --git a/sendgrid/sendgrid.py b/sendgrid/sendgrid.py index bc1454d28..648f8e1cc 100644 --- a/sendgrid/sendgrid.py +++ b/sendgrid/sendgrid.py @@ -1,96 +1,96 @@ -""" -This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python. - -For more information on this library, see the README on GitHub. - http://github.com/sendgrid/sendgrid-python -For more information on the Twilio SendGrid v3 API, see the v3 docs: - http://sendgrid.com/docs/API_Reference/api_v3.html -For the user guide, code examples, and more, visit the main docs page: - http://sendgrid.com/docs/index.html - -This file provides the Twilio SendGrid API Client. -""" - -import os - -import python_http_client - - -class SendGridAPIClient(object): - """The Twilio SendGrid API Client. - - Use this object to interact with the v3 API. For example: - sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) - ... - mail = Mail(from_email, subject, to_email, content) - response = sg.client.mail.send.post(request_body=mail.get()) - - For examples and detailed use instructions, see - https://github.com/sendgrid/sendgrid-python - """ - - def __init__( - self, - api_key=None, - host='https://api.sendgrid.com', - impersonate_subuser=None): - """ - Construct the Twilio SendGrid v3 API object. - Note that the underlying client is being set up during initialization, - therefore changing attributes in runtime will not affect HTTP client - behaviour. - - :param api_key: Twilio SendGrid API key to use. If not provided, key will be - read from environment variable "SENDGRID_API_KEY" - :type api_key: string - :param impersonate_subuser: the subuser to impersonate. Will be passed - by "On-Behalf-Of" header by underlying - client. See - https://sendgrid.com/docs/User_Guide/Settings/subusers.html - for more details - :type impersonate_subuser: string - :param host: base URL for API calls - :type host: string - """ - from . import __version__ - self.api_key = api_key or os.environ.get('SENDGRID_API_KEY') - self.impersonate_subuser = impersonate_subuser - self.host = host - self.version = __version__ - self.useragent = 'sendgrid/{};python'.format(self.version) - - self.client = python_http_client.Client( - host=self.host, - request_headers=self._default_headers, - version=3) - - @property - def _default_headers(self): - """Set the default header for a Twilio SendGrid v3 API call""" - headers = { - "Authorization": 'Bearer {}'.format(self.api_key), - "User-agent": self.useragent, - "Accept": 'application/json' - } - if self.impersonate_subuser: - headers['On-Behalf-Of'] = self.impersonate_subuser - - return headers - - def reset_request_headers(self): - - self.client.request_headers = self._default_headers - - def send(self, message): - """Make a Twilio SendGrid v3 API request with the request body generated by - the Mail object - - :param message: The Twilio SendGrid v3 API request body generated by the Mail - object - :type message: Mail - """ - if isinstance(message, dict): - response = self.client.mail.send.post(request_body=message) - else: - response = self.client.mail.send.post(request_body=message.get()) - return response +""" +This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python. + +For more information on this library, see the README on GitHub. + http://github.com/sendgrid/sendgrid-python +For more information on the Twilio SendGrid v3 API, see the v3 docs: + http://sendgrid.com/docs/API_Reference/api_v3.html +For the user guide, code examples, and more, visit the main docs page: + http://sendgrid.com/docs/index.html + +This file provides the Twilio SendGrid API Client. +""" + +import os + +import python_http_client + + +class SendGridAPIClient(object): + """The Twilio SendGrid API Client. + + Use this object to interact with the v3 API. For example: + sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) + ... + mail = Mail(from_email, subject, to_email, content) + response = sg.client.mail.send.post(request_body=mail.get()) + + For examples and detailed use instructions, see + https://github.com/sendgrid/sendgrid-python + """ + + def __init__( + self, + api_key=None, + host='https://api.sendgrid.com', + impersonate_subuser=None): + """ + Construct the Twilio SendGrid v3 API object. + Note that the underlying client is being set up during initialization, + therefore changing attributes in runtime will not affect HTTP client + behaviour. + + :param api_key: Twilio SendGrid API key to use. If not provided, key will be + read from environment variable "SENDGRID_API_KEY" + :type api_key: string + :param impersonate_subuser: the subuser to impersonate. Will be passed + by "On-Behalf-Of" header by underlying + client. See + https://sendgrid.com/docs/User_Guide/Settings/subusers.html + for more details + :type impersonate_subuser: string + :param host: base URL for API calls + :type host: string + """ + from . import __version__ + self.api_key = api_key or os.environ.get('SENDGRID_API_KEY') + self.impersonate_subuser = impersonate_subuser + self.host = host + self.version = __version__ + self.useragent = 'sendgrid/{};python'.format(self.version) + + self.client = python_http_client.Client( + host=self.host, + request_headers=self._default_headers, + version=3) + + @property + def _default_headers(self): + """Set the default header for a Twilio SendGrid v3 API call""" + headers = { + "Authorization": 'Bearer {}'.format(self.api_key), + "User-Agent": self.useragent, + "Accept": 'application/json' + } + if self.impersonate_subuser: + headers['On-Behalf-Of'] = self.impersonate_subuser + + return headers + + def reset_request_headers(self): + + self.client.request_headers = self._default_headers + + def send(self, message): + """Make a Twilio SendGrid v3 API request with the request body generated by + the Mail object + + :param message: The Twilio SendGrid v3 API request body generated by the Mail + object + :type message: Mail + """ + if isinstance(message, dict): + response = self.client.mail.send.post(request_body=message) + else: + response = self.client.mail.send.post(request_body=message.get()) + return response diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index 29f40924e..d158e402e 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -51,14 +51,14 @@ def test_host(self): def test_get_default_headers(self): headers = self.sg._default_headers self.assertIn('Authorization', headers) - self.assertIn('User-agent', headers) + self.assertIn('User-Agent', headers) self.assertIn('Accept', headers) self.assertNotIn('On-Behalf-Of', headers) self.sg.impersonate_subuser = 'ladida@testsubuser.sendgrid' headers = self.sg._default_headers self.assertIn('Authorization', headers) - self.assertIn('User-agent', headers) + self.assertIn('User-Agent', headers) self.assertIn('Accept', headers) self.assertIn('On-Behalf-Of', headers) From c32a93fee85c563cbe0e14b39a8128c26ff5a4e9 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Fri, 3 Apr 2020 15:33:32 -0500 Subject: [PATCH 036/237] chore: update Travis CI Slack notifications --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 21ecfff65..5d36e954f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,3 +33,11 @@ deploy: on: tags: true python: '3.6' + +notifications: + slack: + if: branch = master + on_success: never + on_failure: change + rooms: + - secure: Yp7gJ6NPRPNgO77vwS0HynSdnU5LYlLlUNBEzcx+zy230UxuLLWcYZtIqsIqt4oZm45OwgJLBwoCMgmU2Jcj79rGyqWKYtUcLMLKgHVzSgxjm2outt2fxjXIJHIU60S3RCGofBJRkPwEMb7ibgwHYBEsH3wIeLrVVbWvimxka6A= From 6dee5432337a6f5756d2e9d29dfaec98c8fae3ef Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Mon, 6 Apr 2020 11:08:45 -0500 Subject: [PATCH 037/237] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5d36e954f..8101380a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ deploy: notifications: slack: if: branch = master + on_pull_requests: false on_success: never on_failure: change rooms: From b10d759b675da0b57ecc835adb22d8d64c2c31cb Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 8 Apr 2020 15:13:37 -0500 Subject: [PATCH 038/237] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65078707f..5ce732f3a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/master.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) [![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python) -[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt) +[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors) [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-python/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-python) @@ -232,4 +232,4 @@ sendgrid-python is maintained and funded by SendGrid, Inc. The names and logos f # License -[The MIT License (MIT)](LICENSE.txt) +[The MIT License (MIT)](LICENSE.md) From 8ce1acf3a9587c6c1ac6992f2afc5facd86146c0 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Wed, 8 Apr 2020 16:19:24 -0500 Subject: [PATCH 039/237] docs: cleanup support/help/contact information --- CONTRIBUTING.md | 2 -- FIRST_TIMERS.md | 8 ++---- README.md | 8 ++---- README.rst | 9 ------ docker/README.md | 6 ---- docker/USAGE.md | 7 ----- examples/helpers/mail_example.py | 26 ++++++++--------- live_test.py | 48 ++++++++++++++++---------------- setup.py | 2 +- test/test_mail_helpers.py | 16 +++++------ use_cases/error_handling.md | 6 ++-- use_cases/kitchen_sink.md | 6 ++-- 12 files changed, 58 insertions(+), 86 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c931fab1..63d07dc75 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -239,8 +239,6 @@ Please run your code through: 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `master` branch. All tests must be passing before we will review the PR. -If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo. - ## Code Reviews If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, GitHub has some great [information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/). diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index 990544b59..714d94bc1 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -65,11 +65,9 @@ Step 2: Get familiar with Twilio SendGrid Service **Step 7:** Push the topic branch up to your fork using `git push origin ` **Step 8:** Open a Pull Request with clear title and description against the master branch. - - In case, you have additional questions, feel free to drop a [mail](dx@sendgrid.com) or open an issue. - + ## Be Patient & Wait for Reviews - Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required ammendments & changes to the PR as asked. + Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required amendments & changes to the PR as asked. -## [Explore New Issues to work upon](https://github.com/sendgrid/sendgrid-python/labels/difficulty%3A%20easy) \ No newline at end of file +## [Explore New Issues to work upon](https://github.com/sendgrid/sendgrid-python/labels/difficulty%3A%20easy) diff --git a/README.md b/README.md index 5ce732f3a..277a1d0c6 100644 --- a/README.md +++ b/README.md @@ -192,8 +192,6 @@ Please see [our helper](https://github.com/sendgrid/sendgrid-python/tree/master/ # Announcements -Join an experienced and passionate team that focuses on making an impact. [Opportunities abound](https://sendgrid.com/careers) to grow the product - and grow your career! - Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated! All updates to this library are documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. @@ -224,11 +222,11 @@ Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-pyth # About -sendgrid-python is guided and supported by the SendGrid Developer Experience Team. +sendgrid-python is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-python are trademarks of Twilio SendGrid, Inc. -Email the Developer Experience Team [here](mailto:dx@sendgrid.com) in case of any queries. +If you need help installing or using the library, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com). -sendgrid-python is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-python are trademarks of SendGrid, Inc. +If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo! # License diff --git a/README.rst b/README.rst index 7d78db946..60be5d2af 100644 --- a/README.rst +++ b/README.rst @@ -221,9 +221,6 @@ Use Cases Announcements ============= -Join an experienced and passionate team that focuses on making an impact. -`Opportunities abound`_ to grow the product - and grow your career! - All updates to this library are documented in our `CHANGELOG`_ and `releases`_. You may also subscribe to email `release notifications`_ for releases and breaking changes. @@ -255,10 +252,6 @@ Please see our `troubleshooting guide`_ for common library issues. About ===== -**sendgrid-python** is guided and supported by the Twilio Developer Experience Team. - -Email the Developer Experience Team `here `__ in case of any queries. - **sendgrid-python** is maintained and funded by Twilio SendGrid, Inc. The names and logos for **sendgrid-python** are trademarks of Twilio SendGrid, Inc. @@ -290,7 +283,6 @@ License .. _v3 Web API Mail Send Helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail .. _Processing Inbound Email: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound .. _Examples of common API use cases: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md -.. _Opportunities abound: https://sendgrid.com/careers .. _breaking changes: https://github.com/sendgrid/sendgrid-python/issues/217 .. _CHANGELOG: https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md .. _releases: https://github.com/sendgrid/sendgrid-python/releases @@ -302,7 +294,6 @@ License .. _Review Pull Requests: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews .. _Sign the CLA to Create a Pull Request: https://cla.sendgrid.com/sendgrid/sendgrid-python .. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md -.. _Developer Experience Team: mailto:dx@sendgrid.com .. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/master/LICENSE.md .. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master diff --git a/docker/README.md b/docker/README.md index 0467daf15..d1a187d31 100644 --- a/docker/README.md +++ b/docker/README.md @@ -60,10 +60,4 @@ For more detailed information, see [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md). -# About - -sendgrid-python is guided and supported by the Twilio SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). - -sendgrid-python is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-python are trademarks of Twilio SendGrid, Inc. - ![Twilio SendGrid Logo](https://sendgrid.com/brand/sg-twilio/SG_Twilio_Lockup_RGBx1.png) diff --git a/docker/USAGE.md b/docker/USAGE.md index 0d3f90b90..77a106c9b 100644 --- a/docker/USAGE.md +++ b/docker/USAGE.md @@ -131,11 +131,4 @@ $ docker-compose up -d sendgrid-beta # Testing Testing is easy! Run the container, `cd sendgrid`, and run `tox`. - -# About - -sendgrid-python is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). - -sendgrid-python is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-python are trademarks of SendGrid, Inc. - ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) diff --git a/examples/helpers/mail_example.py b/examples/helpers/mail_example.py index 040c990d4..c57520a9e 100644 --- a/examples/helpers/mail_example.py +++ b/examples/helpers/mail_example.py @@ -105,8 +105,8 @@ def build_attachment2(): def build_kitchen_sink(): """All settings set""" from sendgrid.helpers.mail import ( - Mail, From, To, Cc, Bcc, Subject, PlainTextContent, - HtmlContent, SendGridException, Substitution, + Mail, From, To, Cc, Bcc, Subject, PlainTextContent, + HtmlContent, SendGridException, Substitution, Header, CustomArg, SendAt, Content, MimeType, Attachment, FileName, FileContent, FileType, Disposition, ContentId, TemplateId, Section, ReplyTo, Category, BatchId, Asm, @@ -123,22 +123,22 @@ def build_kitchen_sink(): message = Mail() - # Define Personalizations + # Define Personalizations message.to = To('test1@sendgrid.com', 'Example User1', p=0) - message.to = [ + message.to = [ To('test2@sendgrid.com', 'Example User2', p=0), To('test3@sendgrid.com', 'Example User3', p=0) ] message.cc = Cc('test4@example.com', 'Example User4', p=0) - message.cc = [ + message.cc = [ Cc('test5@example.com', 'Example User5', p=0), Cc('test6@example.com', 'Example User6', p=0) ] message.bcc = Bcc('test7@example.com', 'Example User7', p=0) - message.bcc = [ + message.bcc = [ Bcc('test8@example.com', 'Example User8', p=0), Bcc('test9@example.com', 'Example User9', p=0) ] @@ -169,19 +169,19 @@ def build_kitchen_sink(): message.send_at = SendAt(1461775051, p=0) message.to = To('test10@example.com', 'Example User10', p=1) - message.to = [ + message.to = [ To('test11@example.com', 'Example User11', p=1), To('test12@example.com', 'Example User12', p=1) ] message.cc = Cc('test13@example.com', 'Example User13', p=1) - message.cc = [ + message.cc = [ Cc('test14@example.com', 'Example User14', p=1), Cc('test15@example.com', 'Example User15', p=1) ] message.bcc = Bcc('test16@example.com', 'Example User16', p=1) - message.bcc = [ + message.bcc = [ Bcc('test17@example.com', 'Example User17', p=1), Bcc('test18@example.com', 'Example User18', p=1) ] @@ -213,9 +213,9 @@ def build_kitchen_sink(): # The values below this comment are global to entire message - message.from_email = From('dx@sendgrid.com', 'DX') + message.from_email = From('help@twilio.com', 'Twilio SendGrid') - message.reply_to = ReplyTo('dx_reply@sendgrid.com', 'DX Reply') + message.reply_to = ReplyTo('help_reply@twilio.com', 'Twilio SendGrid Reply') message.subject = Subject('Sending with SendGrid is Fun 2') @@ -249,7 +249,7 @@ def build_kitchen_sink(): message.section = Section('%section1%', 'Substitution for Section 1 Tag') message.section = [ Section('%section2%', 'Substitution for Section 2 Tag'), - Section('%section3%', 'Substitution for Section 3 Tag') + Section('%section3%', 'Substitution for Section 3 Tag') ] message.header = Header('X-Test9', 'Test9') @@ -293,7 +293,7 @@ def build_kitchen_sink(): tracking_settings.click_tracking = ClickTracking(True, False) tracking_settings.open_tracking = OpenTracking(True, OpenTrackingSubstitutionTag("open_tracking")) tracking_settings.subscription_tracking = SubscriptionTracking( - True, + True, SubscriptionText("Goodbye"), SubscriptionHtml("Goodbye!"), SubscriptionSubstitutionTag("unsubscribe")) diff --git a/live_test.py b/live_test.py index 12c52eeed..d666140fb 100644 --- a/live_test.py +++ b/live_test.py @@ -4,8 +4,8 @@ from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, From, To, Subject, PlainTextContent, HtmlContent, SendGridException -message = Mail(from_email=From('dx@sendgrid.com', 'DX'), - to_emails=To('elmer.thomas@sendgrid.com', 'Elmer Thomas'), +message = Mail(from_email=From('help@twilio.com', 'Twilio SendGrid'), + to_emails=To('ethomas@twilio.com', 'Elmer Thomas'), subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), html_content=HtmlContent('and easy to do anywhere, even with Python')) @@ -27,10 +27,10 @@ from sendgrid.helpers.mail import Mail, From, To, Subject, PlainTextContent, HtmlContent, SendGridException to_emails = [ - To('elmer.thomas@sendgrid.com', 'Elmer SendGrid'), + To('ethomas@twilio.com', 'Elmer SendGrid'), To('elmer.thomas@gmail.com', 'Elmer Thomas') ] -message = Mail(from_email=From('dx@sendgrid.com', 'DX'), +message = Mail(from_email=From('help@twilio.com', 'Twilio SendGrid'), to_emails=to_emails, subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), @@ -56,10 +56,10 @@ import datetime to_emails = [ - To(email='elmer.thomas@sendgrid.com', - name='Elmer SendGrid', + To(email='ethomas@twilio.com', + name='Elmer Twilio', substitutions={ - Substitution('-name-', 'Elmer SendGrid'), + Substitution('-name-', 'Elmer Twilio'), Substitution('-github-', 'http://github.com/ethomas'), }, subject=Subject('Override Global Subject')), @@ -72,7 +72,7 @@ ] ts = time.time() global_substitutions = Substitution('-time-', datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')) -message = Mail(from_email=From('dx@sendgrid.com', 'DX'), +message = Mail(from_email=From('help@twilio.com', 'Twilio SendGrid'), to_emails=to_emails, subject=Subject('Hi -name-'), plain_text_content=PlainTextContent('Hello -name-, your github is -github-, email sent at -time-'), @@ -96,8 +96,8 @@ import json from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import ( - Mail, From, To, Cc, Bcc, Subject, PlainTextContent, - HtmlContent, SendGridException, Substitution, + Mail, From, To, Cc, Bcc, Subject, PlainTextContent, + HtmlContent, SendGridException, Substitution, Header, CustomArg, SendAt, Content, MimeType, Attachment, FileName, FileContent, FileType, Disposition, ContentId, TemplateId, Section, ReplyTo, Category, BatchId, Asm, @@ -114,22 +114,22 @@ message = Mail() -# Define Personalizations +# Define Personalizations message.to = To('elmer+test1@sendgrid.com', 'Example User1', p=0) -message.to = [ +message.to = [ To('elmer+test2@sendgrid.com', 'Example User2', p=0), To('elmer+test3@sendgrid.com', 'Example User3', p=0) ] message.cc = Cc('test4@example.com', 'Example User4', p=0) -message.cc = [ +message.cc = [ Cc('test5@example.com', 'Example User5', p=0), Cc('test6@example.com', 'Example User6', p=0) ] message.bcc = Bcc('test7@example.com', 'Example User7', p=0) -message.bcc = [ +message.bcc = [ Bcc('test8@example.com', 'Example User8', p=0), Bcc('test9@example.com', 'Example User9', p=0) ] @@ -160,19 +160,19 @@ message.send_at = SendAt(1461775051, p=0) message.to = To('test10@example.com', 'Example User10', p=1) -message.to = [ +message.to = [ To('test11@example.com', 'Example User11', p=1), To('test12@example.com', 'Example User12', p=1) ] message.cc = Cc('test13@example.com', 'Example User13', p=1) -message.cc = [ +message.cc = [ Cc('test14@example.com', 'Example User14', p=1), Cc('test15@example.com', 'Example User15', p=1) ] message.bcc = Bcc('test16@example.com', 'Example User16', p=1) -message.bcc = [ +message.bcc = [ Bcc('test17@example.com', 'Example User17', p=1), Bcc('test18@example.com', 'Example User18', p=1) ] @@ -204,9 +204,9 @@ # The values below this comment are global to entire message -message.from_email = From('dx@sendgrid.com', 'DX') +message.from_email = From('help@twilio.com', 'Twilio SendGrid') -message.reply_to = ReplyTo('dx_reply@sendgrid.com', 'DX Reply') +message.reply_to = ReplyTo('help_reply@twilio.com', 'Twilio SendGrid Reply') message.subject = Subject('Sending with SendGrid is Fun 2') @@ -240,7 +240,7 @@ message.section = Section('%section1%', 'Substitution for Section 1 Tag') message.section = [ Section('%section2%', 'Substitution for Section 2 Tag'), - Section('%section3%', 'Substitution for Section 3 Tag') + Section('%section3%', 'Substitution for Section 3 Tag') ] message.header = Header('X-Test9', 'Test9') @@ -284,7 +284,7 @@ tracking_settings.click_tracking = ClickTracking(True, False) tracking_settings.open_tracking = OpenTracking(True, OpenTrackingSubstitutionTag("open_tracking")) tracking_settings.subscription_tracking = SubscriptionTracking( - True, + True, SubscriptionText("Goodbye"), SubscriptionHtml("Goodbye!"), SubscriptionSubstitutionTag("unsubscribe")) @@ -313,8 +313,8 @@ from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, From, To, Subject, PlainTextContent, HtmlContent, SendGridException, DynamicTemplateData -message = Mail(from_email=From('dx@sendgrid.com', 'DX'), - to_emails=To('elmer.thomas@sendgrid.com', 'Elmer Thomas'), +message = Mail(from_email=From('help@twilio.com', 'Twilio SendGrid'), + to_emails=To('ethomas@twilio.com', 'Elmer Thomas'), subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), html_content=HtmlContent('and easy to do anywhere, even with Python')) @@ -354,4 +354,4 @@ print(response.body) print(response.headers) except SendGridException as e: - print(e.message) \ No newline at end of file + print(e.message) diff --git a/setup.py b/setup.py index a2b57099f..1c6c5a8c4 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def getRequires(): name='sendgrid', version=str(__version__), author='Elmer Thomas, Yamil Asusta', - author_email='dx@sendgrid.com', + author_email='help@twilio.com', url='https://github.com/sendgrid/sendgrid-python/', packages=find_packages(exclude=["temp*.py", "test"]), include_package_data=True, diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index 5b04d9037..b29d8b8c2 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -29,7 +29,7 @@ def test_asm(self): asm1.group_id.get(), asm2.group_id.get()) self.assertEqual( asm1.groups_to_display.get(), asm2.groups_to_display.get()) - + def test_attachment(self): from sendgrid.helpers.mail import (FileContent, FileType, FileName, Disposition, ContentId) @@ -48,7 +48,7 @@ def test_attachment(self): '123' ) self.assertEqual(a1.file_content.get(), a2.file_content.get()) - self.assertEqual(a1.file_name.get(), a2.file_name.get()) + self.assertEqual(a1.file_name.get(), a2.file_name.get()) self.assertEqual(a1.file_type.get(), a2.file_type.get()) self.assertEqual(a1.disposition.get(), a2.disposition.get()) self.assertEqual(a1.content_id.get(), a2.content_id.get()) @@ -393,9 +393,9 @@ def test_kitchen_sink(self): # The values below this comment are global to entire message - message.from_email = From('dx@example.com', 'DX') + message.from_email = From('help@twilio.com', 'Twilio SendGrid') - message.reply_to = ReplyTo('dx_reply@example.com', 'DX Reply') + message.reply_to = ReplyTo('help_reply@twilio.com', 'Twilio SendGrid Reply') message.subject = Subject('Sending with SendGrid is Fun 2') @@ -565,8 +565,8 @@ def test_kitchen_sink(self): "transactional6": "false" }, "from": { - "email": "dx@example.com", - "name": "DX" + "email": "help@twilio.com", + "name": "Twilio SendGrid" }, "headers": { "X-Test10": "Test10", @@ -728,8 +728,8 @@ def test_kitchen_sink(self): } ], "reply_to": { - "email": "dx_reply@example.com", - "name": "DX Reply" + "email": "help_reply@twilio.com", + "name": "Twilio SendGrid Reply" }, "sections": { "%section1%": "Substitution for Section 1 Tag", diff --git a/use_cases/error_handling.md b/use_cases/error_handling.md index 5ef2e2dac..eaeabad18 100644 --- a/use_cases/error_handling.md +++ b/use_cases/error_handling.md @@ -12,8 +12,8 @@ There are also email specific exceptions located [here](https://github.com/sendg from python_http_client import exceptions sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) - from_email = From("dx@sendgrid.com") - to_email = To("elmer.thomas@sendgrid.com") + from_email = From("help@twilio.com") + to_email = To("ethomas@twilio.com") subject = Subject("Sending with Twilio SendGrid is Fun") plain_text_content = PlainTextContent("and easy to do anywhere, even with Python") html_content = HtmlContent("and easy to do anywhere, even with Python") @@ -26,4 +26,4 @@ There are also email specific exceptions located [here](https://github.com/sendg except exceptions.BadRequestsError as e: print(e.body) exit() -``` \ No newline at end of file +``` diff --git a/use_cases/kitchen_sink.md b/use_cases/kitchen_sink.md index 92b033588..68c9e057e 100644 --- a/use_cases/kitchen_sink.md +++ b/use_cases/kitchen_sink.md @@ -107,9 +107,9 @@ message.subject = Subject('Sending with Twilio SendGrid is Fun 1', p=1) # The values below this comment are global to entire message -message.from_email = From('dx@example.com', 'DX') +message.from_email = From('help@twilio.com', 'Twilio SendGrid') -message.reply_to = ReplyTo('dx_reply@example.com', 'DX Reply') +message.reply_to = ReplyTo('help_reply@twilio.com', 'Twilio SendGrid Reply') message.subject = Subject('Sending with Twilio SendGrid is Fun 2') @@ -223,4 +223,4 @@ try: print(response.headers) except Exception as e: print(e.message) -``` \ No newline at end of file +``` From 1b56eeebdf12ec356f21392059c53fda02b002f9 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 15 Apr 2020 19:16:07 +0000 Subject: [PATCH 040/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eada85ccd..6c45a1872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-04-15] Version 6.2.2 +-------------------------- +**Library - Fix** +- [PR #881](https://github.com/sendgrid/sendgrid-python/pull/881): correct the User-Agent casing. Thanks to [@childish-sambino](https://github.com/childish-sambino)! + + [2020-04-01] Version 6.2.1 -------------------------- **Library - Docs** From 83b28b882690d296c1d6b4eb979119d5012abbab Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 15 Apr 2020 19:32:50 +0000 Subject: [PATCH 041/237] Release 6.2.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index b133e0c3f..ac1df1f77 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.2.1' +__version__ = '6.2.2' From 1adc410499cfbfbc7a4ec3c062c114d55cb66539 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Tue, 21 Apr 2020 12:38:28 -0500 Subject: [PATCH 042/237] feat: add support for Twilio Email (#882) --- sendgrid/__init__.py | 8 ++--- sendgrid/base_interface.py | 62 ++++++++++++++++++++++++++++++++ sendgrid/sendgrid.py | 56 +++++------------------------ sendgrid/twilio_email.py | 73 ++++++++++++++++++++++++++++++++++++++ test/test_sendgrid.py | 18 +++------- test/test_twilio_email.py | 37 +++++++++++++++++++ use_cases/README.md | 6 ++-- use_cases/sms.md | 50 +++++--------------------- use_cases/twilio-email.md | 16 +++++++++ use_cases/twilio-setup.md | 54 ++++++++++++++++++++++++++++ 10 files changed, 273 insertions(+), 107 deletions(-) create mode 100644 sendgrid/base_interface.py create mode 100644 sendgrid/twilio_email.py create mode 100644 test/test_twilio_email.py create mode 100644 use_cases/twilio-email.md create mode 100644 use_cases/twilio-setup.md diff --git a/sendgrid/__init__.py b/sendgrid/__init__.py index 8923a4484..eb6d58961 100644 --- a/sendgrid/__init__.py +++ b/sendgrid/__init__.py @@ -15,9 +15,9 @@ Modules to help with common tasks. """ -from .version import __version__ -from .sendgrid import SendGridAPIClient # noqa -from .helpers.mail import * # noqa from .helpers.endpoints import * # noqa -# from .helpers.inbound import * # noqa +from .helpers.mail import * # noqa from .helpers.stats import * # noqa +from .sendgrid import SendGridAPIClient # noqa +from .twilio_email import TwilioEmailAPIClient # noqa +from .version import __version__ diff --git a/sendgrid/base_interface.py b/sendgrid/base_interface.py new file mode 100644 index 000000000..92b38247e --- /dev/null +++ b/sendgrid/base_interface.py @@ -0,0 +1,62 @@ +import python_http_client + + +class BaseInterface(object): + def __init__(self, auth, host, impersonate_subuser): + """ + Construct the Twilio SendGrid v3 API object. + Note that the underlying client is being set up during initialization, + therefore changing attributes in runtime will not affect HTTP client + behaviour. + + :param auth: the authorization header + :type auth: string + :param impersonate_subuser: the subuser to impersonate. Will be passed + by "On-Behalf-Of" header by underlying + client. See + https://sendgrid.com/docs/User_Guide/Settings/subusers.html + for more details + :type impersonate_subuser: string + :param host: base URL for API calls + :type host: string + """ + from . import __version__ + self.auth = auth + self.host = host + self.impersonate_subuser = impersonate_subuser + self.version = __version__ + self.useragent = 'sendgrid/{};python'.format(self.version) + + self.client = python_http_client.Client( + host=self.host, + request_headers=self._default_headers, + version=3) + + @property + def _default_headers(self): + """Set the default header for a Twilio SendGrid v3 API call""" + headers = { + "Authorization": self.auth, + "User-Agent": self.useragent, + "Accept": 'application/json' + } + if self.impersonate_subuser: + headers['On-Behalf-Of'] = self.impersonate_subuser + + return headers + + def reset_request_headers(self): + self.client.request_headers = self._default_headers + + def send(self, message): + """Make a Twilio SendGrid v3 API request with the request body generated by + the Mail object + + :param message: The Twilio SendGrid v3 API request body generated by the Mail + object + :type message: Mail + """ + if not isinstance(message, dict): + message = message.get() + + return self.client.mail.send.post(request_body=message) diff --git a/sendgrid/sendgrid.py b/sendgrid/sendgrid.py index 648f8e1cc..912d8336e 100644 --- a/sendgrid/sendgrid.py +++ b/sendgrid/sendgrid.py @@ -13,17 +13,17 @@ import os -import python_http_client +from .base_interface import BaseInterface -class SendGridAPIClient(object): +class SendGridAPIClient(BaseInterface): """The Twilio SendGrid API Client. - Use this object to interact with the v3 API. For example: - sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) + Use this object to interact with the v3 API. For example: + mail_client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) ... mail = Mail(from_email, subject, to_email, content) - response = sg.client.mail.send.post(request_body=mail.get()) + response = mail_client.send(mail) For examples and detailed use instructions, see https://github.com/sendgrid/sendgrid-python @@ -40,8 +40,8 @@ def __init__( therefore changing attributes in runtime will not affect HTTP client behaviour. - :param api_key: Twilio SendGrid API key to use. If not provided, key will be - read from environment variable "SENDGRID_API_KEY" + :param api_key: Twilio SendGrid API key to use. If not provided, value + will be read from environment variable "SENDGRID_API_KEY" :type api_key: string :param impersonate_subuser: the subuser to impersonate. Will be passed by "On-Behalf-Of" header by underlying @@ -52,45 +52,7 @@ def __init__( :param host: base URL for API calls :type host: string """ - from . import __version__ self.api_key = api_key or os.environ.get('SENDGRID_API_KEY') - self.impersonate_subuser = impersonate_subuser - self.host = host - self.version = __version__ - self.useragent = 'sendgrid/{};python'.format(self.version) + auth = 'Bearer {}'.format(self.api_key) - self.client = python_http_client.Client( - host=self.host, - request_headers=self._default_headers, - version=3) - - @property - def _default_headers(self): - """Set the default header for a Twilio SendGrid v3 API call""" - headers = { - "Authorization": 'Bearer {}'.format(self.api_key), - "User-Agent": self.useragent, - "Accept": 'application/json' - } - if self.impersonate_subuser: - headers['On-Behalf-Of'] = self.impersonate_subuser - - return headers - - def reset_request_headers(self): - - self.client.request_headers = self._default_headers - - def send(self, message): - """Make a Twilio SendGrid v3 API request with the request body generated by - the Mail object - - :param message: The Twilio SendGrid v3 API request body generated by the Mail - object - :type message: Mail - """ - if isinstance(message, dict): - response = self.client.mail.send.post(request_body=message) - else: - response = self.client.mail.send.post(request_body=message.get()) - return response + super(SendGridAPIClient, self).__init__(auth, host, impersonate_subuser) diff --git a/sendgrid/twilio_email.py b/sendgrid/twilio_email.py new file mode 100644 index 000000000..78bd01815 --- /dev/null +++ b/sendgrid/twilio_email.py @@ -0,0 +1,73 @@ +""" +This library allows you to quickly and easily use the Twilio Email Web API v3 via Python. + +For more information on this library, see the README on GitHub. + http://github.com/sendgrid/sendgrid-python +For more information on the Twilio SendGrid v3 API, see the v3 docs: + http://sendgrid.com/docs/API_Reference/api_v3.html +For the user guide, code examples, and more, visit the main docs page: + http://sendgrid.com/docs/index.html + +This file provides the Twilio Email API Client. +""" +import os +from base64 import b64encode + +from .base_interface import BaseInterface + + +class TwilioEmailAPIClient(BaseInterface): + """The Twilio Email API Client. + + Use this object to interact with the v3 API. For example: + mail_client = sendgrid.TwilioEmailAPIClient(os.environ.get('TWILIO_API_KEY'), + os.environ.get('TWILIO_API_SECRET')) + ... + mail = Mail(from_email, subject, to_email, content) + response = mail_client.send(mail) + + For examples and detailed use instructions, see + https://github.com/sendgrid/sendgrid-python + """ + + def __init__( + self, + username=None, + password=None, + host='https://email.twilio.com', + impersonate_subuser=None): + """ + Construct the Twilio Email v3 API object. + Note that the underlying client is being set up during initialization, + therefore changing attributes in runtime will not affect HTTP client + behaviour. + + :param username: Twilio Email API key SID or Account SID to use. If not + provided, value will be read from the environment + variable "TWILIO_API_KEY" or "TWILIO_ACCOUNT_SID" + :type username: string + :param password: Twilio Email API key secret or Account Auth Token to + use. If not provided, value will be read from the + environment variable "TWILIO_API_SECRET" or + "TWILIO_AUTH_TOKEN" + :type password: string + :param impersonate_subuser: the subuser to impersonate. Will be passed + by "On-Behalf-Of" header by underlying + client. See + https://sendgrid.com/docs/User_Guide/Settings/subusers.html + for more details + :type impersonate_subuser: string + :param host: base URL for API calls + :type host: string + """ + self.username = username or \ + os.environ.get('TWILIO_API_KEY') or \ + os.environ.get('TWILIO_ACCOUNT_SID') + + self.password = password or \ + os.environ.get('TWILIO_API_SECRET') or \ + os.environ.get('TWILIO_AUTH_TOKEN') + + auth = 'Basic ' + b64encode('{}:{}'.format(self.username, self.password).encode()).decode() + + super(TwilioEmailAPIClient, self).__init__(auth, host, impersonate_subuser) diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index d158e402e..71b0ab6ff 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -1,10 +1,10 @@ -import sendgrid -from sendgrid.helpers.endpoints.ip.unassigned import unassigned -from sendgrid.helpers.mail import * -import os import datetime +import os import unittest +import sendgrid +from sendgrid.helpers.endpoints.ip.unassigned import unassigned + host = "http://localhost:4010" @@ -18,12 +18,9 @@ def setUpClass(cls): os.path.dirname(__file__)), '/..') cls.sg = sendgrid.SendGridAPIClient(host=host) cls.devnull = open(os.devnull, 'w') - prism_cmd = None def test_api_key_init(self): self.assertEqual(self.sg.api_key, os.environ.get('SENDGRID_API_KEY')) - # Support the previous naming convention for API keys - self.assertEqual(self.sg.api_key, self.sg.api_key) my_sendgrid = sendgrid.SendGridAPIClient(api_key="THISISMYKEY") self.assertEqual(my_sendgrid.api_key, "THISISMYKEY") @@ -2305,7 +2302,7 @@ def test_whitelabel_links__link_id__subuser_post(self): def test_license_year(self): LICENSE_FILE = 'LICENSE.md' - copyright_line='' + copyright_line = '' with open(LICENSE_FILE, 'r') as f: for line in f: if line.startswith('Copyright'): @@ -2314,8 +2311,3 @@ def test_license_year(self): self.assertEqual( 'Copyright (C) %s, Twilio SendGrid, Inc. ' % datetime.datetime.now().year, copyright_line) - - # @classmethod - # def tearDownClass(cls): - # cls.p.kill() - # print("Prism Shut Down") diff --git a/test/test_twilio_email.py b/test/test_twilio_email.py new file mode 100644 index 000000000..92269acff --- /dev/null +++ b/test/test_twilio_email.py @@ -0,0 +1,37 @@ +import os +import unittest + +from sendgrid import TwilioEmailAPIClient + + +class UnitTests(unittest.TestCase): + + @classmethod + def setUpClass(cls): + os.environ['TWILIO_API_KEY'] = 'api-key' + os.environ['TWILIO_API_SECRET'] = 'api-secret' + os.environ['TWILIO_ACCOUNT_SID'] = 'account-sid' + os.environ['TWILIO_AUTH_TOKEN'] = 'auth-token' + + def test_init_key_over_token(self): + mail_client = TwilioEmailAPIClient() + + self.assertEqual(mail_client.username, 'api-key') + self.assertEqual(mail_client.password, 'api-secret') + self.assertEqual(mail_client.host, 'https://email.twilio.com') + + def test_init_token(self): + del os.environ['TWILIO_API_KEY'] + del os.environ['TWILIO_API_SECRET'] + + mail_client = TwilioEmailAPIClient() + + self.assertEqual(mail_client.username, 'account-sid') + self.assertEqual(mail_client.password, 'auth-token') + + def test_init_args(self): + mail_client = TwilioEmailAPIClient('username', 'password') + + self.assertEqual(mail_client.username, 'username') + self.assertEqual(mail_client.password, 'password') + self.assertEqual(mail_client.auth, 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=') diff --git a/use_cases/README.md b/use_cases/README.md index 46a508795..a91f1f5a4 100644 --- a/use_cases/README.md +++ b/use_cases/README.md @@ -18,8 +18,10 @@ This directory provides examples for specific use cases of this library. Please * [Integrate with Slack Events API](slack_event_api_integration.md) * [Legacy Templates](legacy_templates.md) -### Working with SMS -* [Send a SMS Message](sms.md) +# Twilio Use Cases +* [Twilio Setup](twilio-setup.md) +* [Send an Email With Twilio Email (Pilot)](twilio-email.md) +* [Send an SMS Message](sms.md) ### Troubleshooting * [Error Handling](error_handling.md) diff --git a/use_cases/sms.md b/use_cases/sms.md index bd8655171..1e51f0a25 100644 --- a/use_cases/sms.md +++ b/use_cases/sms.md @@ -1,43 +1,12 @@ -Following are the steps to add Twilio SMS to your app: +First, follow the [Twilio Setup](twilio-setup.md) guide for creating a Twilio account and setting up environment variables with the proper credentials. -## 1. Obtain a Free Twilio Account - -Sign up for a free Twilio account [here](https://www.twilio.com/try-twilio?source=sendgrid-python). - -## 2. Update Your Environment Variables - -You can obtain your Account Sid and Auth Token from [twilio.com/console](https://twilio.com/console). - -### Mac +Then, install the Twilio Helper Library. ```bash -echo "export TWILIO_ACCOUNT_SID='YOUR_TWILIO_ACCOUNT_SID'" > twilio.env -echo "export TWILIO_AUTH_TOKEN='YOUR_TWILIO_AUTH_TOKEN'" >> twilio.env -echo "twilio.env" >> .gitignore -source ./twilio.env +pip install twilio ``` -### Windows - -Temporarily set the environment variable (accessible only during the current CLI session): - -```bash -set TWILIO_ACCOUNT_SID=YOUR_TWILIO_ACCOUNT_SID -set TWILIO_AUTH_TOKEN=YOUR_TWILIO_AUTH_TOKEN -``` - -Permanently set the environment variable (accessible in all subsequent CLI sessions): - -```bash -setx TWILIO_ACCOUNT_SID "YOUR_TWILIO_ACCOUNT_SID" -setx TWILIO_AUTH_TOKEN "YOUR_TWILIO_AUTH_TOKEN" -``` - -## 3. Install the Twilio Helper Library - -`pip install twilio` - -Then, you can execute the following code. +Finally, send a message. ```python import os @@ -50,12 +19,11 @@ to_number ='+15558675310' body = "Join Earth's mightiest heroes. Like Kevin Bacon." client = Client(account_sid, auth_token) -message = client.messages \ - .create( - body=body, - from_=from_number, - to=to_number - ) +message = client.messages.create( + body=body, + from_=from_number, + to=to_number +) print(message.sid) ``` diff --git a/use_cases/twilio-email.md b/use_cases/twilio-email.md new file mode 100644 index 000000000..c8f0373d8 --- /dev/null +++ b/use_cases/twilio-email.md @@ -0,0 +1,16 @@ +First, follow the [Twilio Setup](twilio-setup.md) guide for creating a Twilio account and setting up environment variables with the proper credentials. + +Then, initialize the Twilio Email Client. + +```python +import sendgrid +import os + +mail_client = sendgrid.TwilioEmailAPIClient(os.environ.get('TWILIO_API_KEY'), os.environ.get('TWILIO_API_SECRET')) + +# or + +mail_client = sendgrid.TwilioEmailAPIClient(os.environ.get('TWILIO_ACCOUNT_SID'), os.environ.get('TWILIO_AUTH_TOKEN')) +``` + +This client has the same interface as the `SendGridAPIClient` client. diff --git a/use_cases/twilio-setup.md b/use_cases/twilio-setup.md new file mode 100644 index 000000000..315cd3b32 --- /dev/null +++ b/use_cases/twilio-setup.md @@ -0,0 +1,54 @@ +## 1. Obtain a Free Twilio Account + +Sign up for a free Twilio account [here](https://www.twilio.com/try-twilio?source=sendgrid-nodejs). + +## 2. Set Up Your Environment Variables + +The Twilio API allows for authentication using with either an API key/secret or your Account SID/Auth Token. You can create an API key [here](https://twil.io/get-api-key) or obtain your Account SID and Auth Token [here](https://twil.io/console). + +Once you have those, follow the steps below based on your operating system. + +### Linux/Mac + +```bash +echo "export TWILIO_API_KEY='YOUR_TWILIO_API_KEY'" > twilio.env +echo "export TWILIO_API_SECRET='YOUR_TWILIO_API_SECRET'" >> twilio.env + +# or + +echo "export TWILIO_ACCOUNT_SID='YOUR_TWILIO_ACCOUNT_SID'" > twilio.env +echo "export TWILIO_AUTH_TOKEN='YOUR_TWILIO_AUTH_TOKEN'" >> twilio.env +``` + +Then: + +```bash +echo "twilio.env" >> .gitignore +source ./twilio.env +``` + +### Windows + +Temporarily set the environment variable (accessible only during the current CLI session): + +```bash +set TWILIO_API_KEY=YOUR_TWILIO_API_KEY +set TWILIO_API_SECRET=YOUR_TWILIO_API_SECRET + +: or + +set TWILIO_ACCOUNT_SID=YOUR_TWILIO_ACCOUNT_SID +set TWILIO_AUTH_TOKEN=YOUR_TWILIO_AUTH_TOKEN +``` + +Or permanently set the environment variable (accessible in all subsequent CLI sessions): + +```bash +setx TWILIO_API_KEY "YOUR_TWILIO_API_KEY" +setx TWILIO_API_SECRET "YOUR_TWILIO_API_SECRET" + +: or + +setx TWILIO_ACCOUNT_SID "YOUR_TWILIO_ACCOUNT_SID" +setx TWILIO_AUTH_TOKEN "YOUR_TWILIO_AUTH_TOKEN" +``` From 336999eba734fec74a2471b2e8ac620c15f3c8e5 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Wed, 22 Apr 2020 11:02:02 -0500 Subject: [PATCH 043/237] docs: correct 'personalization' spelling --- sendgrid/helpers/mail/mail.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index a938929be..5ac3ef800 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -3,24 +3,23 @@ from .cc_email import Cc from .content import Content from .custom_arg import CustomArg +from .dynamic_template_data import DynamicTemplateData from .email import Email from .from_email import From from .header import Header -from .html_content import HtmlContent from .mime_type import MimeType from .personalization import Personalization -from .plain_text_content import PlainTextContent from .reply_to import ReplyTo from .send_at import SendAt from .subject import Subject from .substitution import Substitution from .template_id import TemplateId from .to_email import To -from .dynamic_template_data import DynamicTemplateData class Mail(object): """Creates the response body for v3/mail/send""" + def __init__( self, from_email=None, @@ -135,7 +134,7 @@ def _set_emails( :type emails: Email, list(Email) :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -215,7 +214,7 @@ def to(self, to_emails, global_substitutions=None, is_multiple=False, p=0): :type to_emails: To, list(To), str, tuple :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -239,11 +238,11 @@ def add_to( self, to_email, global_substitutions=None, is_multiple=False, p=0): """Adds a To object to the Personalization object - :param to_emails: A To object - :type to_emails: To, str, tuple + :param to_email: A To object + :type to_email: To, str, tuple :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -278,7 +277,7 @@ def cc(self, cc_emails, global_substitutions=None, is_multiple=False, p=0): :type cc_emails: Cc, list(Cc), tuple :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -306,7 +305,7 @@ def add_cc( :type to_emails: Cc :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -338,7 +337,7 @@ def bcc( :type bcc_emails: Bcc, list(Bcc), tuple :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -370,7 +369,7 @@ def add_bcc( :type to_emails: Bcc :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict - :param is_multiple: Create a new personilization for each recipient + :param is_multiple: Create a new personalization for each recipient :type is_multiple: bool :param p: p is the Personalization object or Personalization object index @@ -476,7 +475,7 @@ def add_header(self, header): if isinstance(header, dict): (k, v) = list(header.items())[0] self._headers = self._ensure_append( - Header(k, v), self._headers) + Header(k, v), self._headers) else: self._headers = self._ensure_append(header, self._headers) @@ -951,7 +950,7 @@ def get(self): 'headers': self._flatten_dicts(self.headers), 'categories': [c.get() for c in self.categories or []], 'custom_args': self._flatten_dicts(self.custom_args), - 'send_at': self._get_or_none(self.send_at), + 'send_at': self._get_or_none(self.send_at), 'batch_id': self._get_or_none(self.batch_id), 'asm': self._get_or_none(self.asm), 'ip_pool_name': self._get_or_none(self.ip_pool_name), From ca8bf29e68066bd89ef99b92207f3f4a9eed03c3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 29 Apr 2020 19:27:53 +0000 Subject: [PATCH 044/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c45a1872..5536d7f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-04-29] Version 6.3.0 +-------------------------- +**Library - Feature** +- [PR #882](https://github.com/sendgrid/sendgrid-python/pull/882): add support for Twilio Email. Thanks to [@childish-sambino](https://github.com/childish-sambino)! + + [2020-04-15] Version 6.2.2 -------------------------- **Library - Fix** From 11d526c699feccee218a09abe38d7fa3b6e3fc10 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 29 Apr 2020 19:35:12 +0000 Subject: [PATCH 045/237] Release 6.3.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index ac1df1f77..89d98bf88 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.2.2' +__version__ = '6.3.0' From ee02b3038e33e358076b7d3ee2b1fcba6fd57684 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Tue, 5 May 2020 11:37:16 -0500 Subject: [PATCH 046/237] fix: migrate to common prism setup (#888) --- .gitignore | 1 + .travis.yml | 26 +++++++++---------- Dockerfile | 12 +++++++++ Makefile | 14 +++++++---- test/prism.sh | 58 ------------------------------------------- test/test_sendgrid.py | 8 ++---- 6 files changed, 36 insertions(+), 83 deletions(-) create mode 100644 Dockerfile delete mode 100755 test/prism.sh diff --git a/.gitignore b/.gitignore index 2c374a9e9..53f5e85ed 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ __pycache__ example.pdf TODO.txt twilio.env +prism diff --git a/.travis.yml b/.travis.yml index 8101380a5..d44eb2352 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,25 @@ dist: xenial # required for Python >= 3.7 language: python cache: pip -python: - - '2.7' - - '3.5' - - '3.6' - - '3.7' - - '3.8' +services: + - docker env: + matrix: + - version=2.7 + - version=3.5 + - version=3.6 + - version=3.7 + - version=3.8 global: - - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN SENDGRID_API_KEY=SGAPIKEY -install: - - make install - - make test-install + - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN before_script: - - "./test/prism.sh &" - - sleep 20 - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - - . venv/bin/activate; coverage run -m unittest discover + - make test-docker after_script: + - make test-install - . venv/bin/activate; codecov - ./cc-test-reporter after-build --exit-code $? deploy: @@ -32,7 +30,7 @@ deploy: distributions: sdist bdist_wheel on: tags: true - python: '3.6' + condition: $version=3.6 notifications: slack: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6f75cd98f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +ARG version=latest +FROM python:$version + +RUN pip install virtualenv + +COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt +RUN update-ca-certificates + +WORKDIR /app +COPY . . + +RUN make install diff --git a/Makefile b/Makefile index 0e275b62b..27d2056c4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: venv install test-install test clean nopyc +.PHONY: venv install test-install test test-integ test-docker clean nopyc venv: @python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1); @@ -8,13 +8,17 @@ install: venv . venv/bin/activate; python setup.py install . venv/bin/activate; pip install -r requirements.txt -test-install: +test-install: install . venv/bin/activate; pip install -r test/requirements.txt test: test-install - ./test/prism.sh & - sleep 2 - . venv/bin/activate; python -m unittest discover -v + +test-integ: test + . venv/bin/activate; coverage run -m unittest discover + +version ?= latest +test-docker: + curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/prism/prism.sh | version=$(version) bash clean: nopyc rm -rf venv diff --git a/test/prism.sh b/test/prism.sh deleted file mode 100755 index cc6a0bb15..000000000 --- a/test/prism.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -set -eu - -install () { - -echo "Installing Prism..." - -UNAME=$(uname) -ARCH=$(uname -m) -if [ "$UNAME" != "Linux" ] && [ "$UNAME" != "Darwin" ] && [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "i686" ]; then - echo "Sorry, OS/Architecture not supported: ${UNAME}/${ARCH}. Download binary from https://github.com/stoplightio/prism/releases" - exit 1 -fi - -if [ "$UNAME" = "Darwin" ] ; then - OSX_ARCH=$(uname -m) - if [ "${OSX_ARCH}" = "x86_64" ] ; then - PLATFORM="darwin_amd64" - fi -elif [ "$UNAME" = "Linux" ] ; then - LINUX_ARCH=$(uname -m) - if [ "${LINUX_ARCH}" = "i686" ] ; then - PLATFORM="linux_386" - elif [ "${LINUX_ARCH}" = "x86_64" ] ; then - PLATFORM="linux_amd64" - fi -fi - -mkdir -p ../prism/bin -#LATEST=$(curl -s https://api.github.com/repos/stoplightio/prism/tags | grep -Eo '"name":.*?[^\\]",' | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2) -LATEST="v0.6.21" -URL="https://github.com/stoplightio/prism/releases/download/$LATEST/prism_$PLATFORM" -DEST=../prism/bin/prism - -if [ -z $LATEST ] ; then - echo "Error requesting. Download binary from ${URL}" - exit 1 -else - curl -L $URL -o $DEST - chmod +x $DEST -fi -} - -run () { - echo "Running prism..." - cd ../prism/bin - ./prism run --mock --spec https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json -} - -if [ -f ../prism/bin/prism ]; then - echo "Prism is already installed." - run -else - echo "Prism is not installed." - install - run -fi \ No newline at end of file diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index 71b0ab6ff..eb9ebabb3 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -5,18 +5,15 @@ import sendgrid from sendgrid.helpers.endpoints.ip.unassigned import unassigned -host = "http://localhost:4010" - class UnitTests(unittest.TestCase): @classmethod def setUpClass(cls): - cls.host = host cls.path = '{}{}'.format( os.path.abspath( os.path.dirname(__file__)), '/..') - cls.sg = sendgrid.SendGridAPIClient(host=host) + cls.sg = sendgrid.SendGridAPIClient() cls.devnull = open(os.devnull, 'w') def test_api_key_init(self): @@ -34,7 +31,6 @@ def test_api_key_setter(self): def test_impersonate_subuser_init(self): temp_subuser = 'abcxyz@this.is.a.test.subuser' sg_impersonate = sendgrid.SendGridAPIClient( - host=host, impersonate_subuser=temp_subuser) self.assertEqual(sg_impersonate.impersonate_subuser, temp_subuser) @@ -43,7 +39,7 @@ def test_useragent(self): self.assertEqual(self.sg.useragent, useragent) def test_host(self): - self.assertEqual(self.sg.host, self.host) + self.assertEqual(self.sg.host, 'https://api.sendgrid.com') def test_get_default_headers(self): headers = self.sg._default_headers From e1e53496b7e1979e0c12b3bc80c84056b19d5b71 Mon Sep 17 00:00:00 2001 From: Paul McMillan Date: Tue, 12 May 2020 07:21:48 -0700 Subject: [PATCH 047/237] docs: Update readme supported versions (#893) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 277a1d0c6..09b0ce68c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ We appreciate your continued support, thank you! ## Prerequisites -- Python version 2.6, 2.7, 3.4, 3.5 or 3.6 +- Python version 2.7, 3.5, 3.6, 3.7, or 3.8 - The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-python) ## Setup Environment Variables From 5d5fb2779c2c4c468c0917c9979e26b86c00d843 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 13 May 2020 19:45:11 +0000 Subject: [PATCH 048/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5536d7f0b..890c0145b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-05-13] Version 6.3.1 +-------------------------- +**Library - Docs** +- [PR #893](https://github.com/sendgrid/sendgrid-python/pull/893): Update readme supported versions. Thanks to [@PaulMcMillan](https://github.com/PaulMcMillan)! + +**Library - Fix** +- [PR #888](https://github.com/sendgrid/sendgrid-python/pull/888): migrate to common prism setup. Thanks to [@childish-sambino](https://github.com/childish-sambino)! + + [2020-04-29] Version 6.3.0 -------------------------- **Library - Feature** From 9ff4e296545db27457424398ac205185749484f3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 13 May 2020 20:08:41 +0000 Subject: [PATCH 049/237] Release 6.3.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 89d98bf88..ea089f2db 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.3.0' +__version__ = '6.3.1' From 2377c406f667f0da3bba3fb9fd5ffe79b10533ec Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 15 May 2020 09:49:44 -0500 Subject: [PATCH 050/237] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d44eb2352..d01aedaea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ deploy: distributions: sdist bdist_wheel on: tags: true - condition: $version=3.6 + condition: env(version)=3.6 notifications: slack: From 09f787662e247f102494ce43091503daecc4f86a Mon Sep 17 00:00:00 2001 From: Dmitriy Krasilnikov Date: Mon, 18 May 2020 16:41:35 +0300 Subject: [PATCH 051/237] docs: Fixed Subject typo (#895) --- sendgrid/helpers/mail/subject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/subject.py b/sendgrid/helpers/mail/subject.py index a7fecec8f..1637f4004 100644 --- a/sendgrid/helpers/mail/subject.py +++ b/sendgrid/helpers/mail/subject.py @@ -2,7 +2,7 @@ class Subject(object): """A subject for an email message.""" def __init__(self, subject, p=None): - """Create a Subjuct. + """Create a Subject. :param subject: The subject for an email :type subject: string From a2171d1273a3f30338fb473bd1cb763c9b1e8b7d Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 27 May 2020 18:52:50 +0000 Subject: [PATCH 052/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 890c0145b..b4d776082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-05-27] Version 6.3.2 +-------------------------- +**Library - Docs** +- [PR #895](https://github.com/sendgrid/sendgrid-python/pull/895): Fixed Subject typo. Thanks to [@dmitry-krasilnikov](https://github.com/dmitry-krasilnikov)! + + [2020-05-13] Version 6.3.1 -------------------------- **Library - Docs** From 257d9f514670c0ade1fbb60a520fd6692563ee9a Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 27 May 2020 18:58:15 +0000 Subject: [PATCH 053/237] Release 6.3.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index ea089f2db..144bf2f7f 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.3.1' +__version__ = '6.3.2' From 12ace42c1fd786df8818e5802af9239ba8008db3 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Fri, 29 May 2020 09:27:39 -0500 Subject: [PATCH 054/237] feat: allow interactive docker testing with 'command' env var Piping to the 'bash' command does not allow for interacting with the Docker container when running the 'test-docker' make target. By moving it to its own line, the interaction is now allowed. Example: `command=bash make test-docker` --- .gitignore | 2 +- Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 53f5e85ed..504640243 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,4 @@ __pycache__ example.pdf TODO.txt twilio.env -prism +prism* diff --git a/Makefile b/Makefile index 27d2056c4..fe7f18e97 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ test-integ: test version ?= latest test-docker: - curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/prism/prism.sh | version=$(version) bash + curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/prism/prism.sh -o prism.sh + version=$(version) bash ./prism.sh clean: nopyc rm -rf venv From 10d6eb0152fbbfb49adaf99b1e7a6054ee6302be Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Fri, 29 May 2020 10:05:16 -0500 Subject: [PATCH 055/237] docs: shorten and correct the issue template link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63d07dc75..41a454683 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ Before you decide to create a new issue, please try the following: ### Please use our Bug Report Template -In order to make the process easier, we've included a [sample bug report template]((https://github.com/sendgrid/sendgrid-python/ISSUE_TEMPLATE.md)) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. +In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md). ## Improvements to the Codebase From 6fe3d3c78e9a9aeb498d588529600af8018b63ab Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 3 Jun 2020 10:47:41 -0500 Subject: [PATCH 056/237] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d01aedaea..489a4a788 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ deploy: distributions: sdist bdist_wheel on: tags: true - condition: env(version)=3.6 + condition: $version = 3.6 notifications: slack: From 75cc2d15feff643e6d17258d04cf5ece95fc01b9 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 12 Jun 2020 09:45:00 -0500 Subject: [PATCH 057/237] fix: revert "feat: Add equality to Email" (#904) This reverts commit b2ca1f4b9dfa32ad7ff829c52d0a5efd9128a2f3. --- sendgrid/helpers/mail/email.py | 21 --------------- test/test_email.py | 48 ---------------------------------- 2 files changed, 69 deletions(-) diff --git a/sendgrid/helpers/mail/email.py b/sendgrid/helpers/mail/email.py index 10a8718b1..3c2cb3bbb 100644 --- a/sendgrid/helpers/mail/email.py +++ b/sendgrid/helpers/mail/email.py @@ -73,27 +73,6 @@ def __init__(self, if p is not None: self.personalization = p - def __eq__(self, other): - """Email objects are equal if they have the same email and the same name - - :param other: object to compare with - :type other: any - """ - if isinstance(other, Email): - return self.email == other.email and self.name == other.name - return NotImplemented - - def __ne__(self, other): - """Inverse of __eq__ (required for Python 2) - - :param other: object to compare with - :type other: any - """ - x = self.__eq__(other) - if x is not NotImplemented: - return not x - return NotImplemented - @property def name(self): """Name associated with this email. diff --git a/test/test_email.py b/test/test_email.py index c8614fe17..eb50374aa 100644 --- a/test/test_email.py +++ b/test/test_email.py @@ -80,51 +80,3 @@ def test_add_unicode_name_with_comma(self): email.name = name self.assertEqual(email.name, u'"' + name + u'"') - - def test_equality_email_name(self): - address = "test@example.com" - name = "SomeName" - email1 = Email(address, name) - email2 = Email(address, name) - - self.assertEqual(email1, email2) - - def test_equality_email(self): - address = "test@example.com" - email1 = Email(address) - email2 = Email(address) - - self.assertEqual(email1, email2) - - def test_equality_name(self): - name = "SomeName" - email1 = Email() - email1.name = name - email2 = Email() - email2.name = name - - self.assertEqual(email1, email2) - - def test_equality_different_emails(self): - address1 = "test1@example.com" - email1 = Email(address1) - address2 = "test2@example.com" - email2 = Email(address2) - - self.assertNotEqual(email1, email2) - - def test_equality_different_name(self): - name1 = "SomeName1" - email1 = Email() - email1.name = name1 - name2 = "SomeName2" - email2 = Email() - email2.name = name2 - - self.assertNotEqual(email1, email2) - - def test_equality_non_email(self): - address = "test@example.com" - email = Email(address) - - self.assertNotEqual(email, address) From cb58667142e30642b9b60318b834c0713c71ac12 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Mon, 15 Jun 2020 10:16:10 -0700 Subject: [PATCH 058/237] feat: verify signature from event webhook (#901) When enabling the "Signed Event Webhook Requests" feature in Mail Settings, Twilio SendGrid will generate a private and public key pair using the Elliptic Curve Digital Signature Algorithm (ECDSA). Once that is successfully enabled, all new event posts will have two new headers: X-Twilio-Email-Event-Webhook-Signature and X-Twilio-Email-Event-Webhook-Timestamp, which can be used to validate your events. This SDK update will make it easier to verify signatures from signed event webhook requests by using the VerifySignature method. Pass in the public key, event payload, signature, and timestamp to validate. Note: You will need to convert your public key string to an elliptic public key object in order to use the VerifySignature method. --- Makefile | 2 +- .../eventwebhook/eventwebhook_example.py | 14 ++++++ requirements.txt | 1 + sendgrid/__init__.py | 1 + sendgrid/helpers/eventwebhook/__init__.py | 50 +++++++++++++++++++ .../eventwebhook/eventwebhook_header.py | 10 ++++ sendgrid/helpers/inbound/config.py | 2 +- test/test_eventwebhook.py | 42 ++++++++++++++++ 8 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 examples/helpers/eventwebhook/eventwebhook_example.py create mode 100644 sendgrid/helpers/eventwebhook/__init__.py create mode 100644 sendgrid/helpers/eventwebhook/eventwebhook_header.py create mode 100644 test/test_eventwebhook.py diff --git a/Makefile b/Makefile index fe7f18e97..356d46682 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: venv install test-install test test-integ test-docker clean nopyc -venv: +venv: clean @python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1); virtualenv --python=python venv diff --git a/examples/helpers/eventwebhook/eventwebhook_example.py b/examples/helpers/eventwebhook/eventwebhook_example.py new file mode 100644 index 000000000..91ad8d64b --- /dev/null +++ b/examples/helpers/eventwebhook/eventwebhook_example.py @@ -0,0 +1,14 @@ +from sendgrid.helpers.eventwebhook import EventWebhook, EventWebhookHeader + +def is_valid_signature(request): + public_key = 'base64-encoded public key' + + event_webhook = EventWebhook() + ec_public_key = event_webhook.convert_public_key_to_ecdsa(public_key) + + return event_webhook.verify_signature( + request.text, + request.headers[EventWebhookHeader.SIGNATURE], + request.headers[EventWebhookHeader.TIMESTAMP], + ec_public_key + ) diff --git a/requirements.txt b/requirements.txt index ce29b7f3e..ff1ba3c35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ PyYAML>=4.2b1 python-http-client>=3.2.1 six==1.11.0 pytest==3.8.2 +starkbank-ecdsa>=1.0.0 diff --git a/sendgrid/__init__.py b/sendgrid/__init__.py index eb6d58961..cd994dd2f 100644 --- a/sendgrid/__init__.py +++ b/sendgrid/__init__.py @@ -18,6 +18,7 @@ from .helpers.endpoints import * # noqa from .helpers.mail import * # noqa from .helpers.stats import * # noqa +from .helpers.eventwebhook import * # noqa from .sendgrid import SendGridAPIClient # noqa from .twilio_email import TwilioEmailAPIClient # noqa from .version import __version__ diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py new file mode 100644 index 000000000..a44eb5b89 --- /dev/null +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -0,0 +1,50 @@ +from ellipticcurve.ecdsa import Ecdsa +from ellipticcurve.publicKey import PublicKey +from ellipticcurve.signature import Signature + +from .eventwebhook_header import EventWebhookHeader + +class EventWebhook: + """ + This class allows you to use the Event Webhook feature. Read the docs for + more details: https://sendgrid.com/docs/for-developers/tracking-events/event + """ + + def __init__(self, public_key=None): + """ + Construct the Event Webhook verifier object + :param public_key: verification key under Mail Settings + :type public_key: string + """ + self.public_key = self.convert_public_key_to_ecdsa(public_key) if public_key else public_key + + def convert_public_key_to_ecdsa(self, public_key): + """ + Convert the public key string to a ECPublicKey. + + :param public_key: verification key under Mail Settings + :type public_key string + :return: public key using the ECDSA algorithm + :rtype PublicKey + """ + return PublicKey.fromPem(public_key) + + def verify_signature(self, payload, signature, timestamp, public_key=None): + """ + Verify signed event webhook requests. + + :param payload: event payload in the request body + :type payload: string + :param signature: value obtained from the 'X-Twilio-Email-Event-Webhook-Signature' header + :type signature: string + :param timestamp: value obtained from the 'X-Twilio-Email-Event-Webhook-Timestamp' header + :type timestamp: string + :param public_key: elliptic curve public key + :type public_key: PublicKey + :return: true or false if signature is valid + """ + timestamped_payload = timestamp + payload + decoded_signature = Signature.fromBase64(signature) + + key = public_key or self.public_key + return Ecdsa.verify(timestamped_payload, decoded_signature, key) diff --git a/sendgrid/helpers/eventwebhook/eventwebhook_header.py b/sendgrid/helpers/eventwebhook/eventwebhook_header.py new file mode 100644 index 000000000..a41a48524 --- /dev/null +++ b/sendgrid/helpers/eventwebhook/eventwebhook_header.py @@ -0,0 +1,10 @@ +class EventWebhookHeader: + """ + This class lists headers that get posted to the webhook. Read the docs for + more details: https://sendgrid.com/docs/for-developers/tracking-events/event + """ + SIGNATURE = 'X-Twilio-Email-Event-Webhook-Signature' + TIMESTAMP = 'X-Twilio-Email-Event-Webhook-Timestamp' + + def __init__(self): + pass diff --git a/sendgrid/helpers/inbound/config.py b/sendgrid/helpers/inbound/config.py index 32bec0793..06ca683cb 100644 --- a/sendgrid/helpers/inbound/config.py +++ b/sendgrid/helpers/inbound/config.py @@ -16,7 +16,7 @@ def __init__(self, **opts): 'path', os.path.abspath(os.path.dirname(__file__)) ) with open('{0}/config.yml'.format(self.path)) as stream: - config = yaml.load(stream) + config = yaml.load(stream, Loader=yaml.FullLoader) self._debug_mode = config['debug_mode'] self._endpoint = config['endpoint'] self._host = config['host'] diff --git a/test/test_eventwebhook.py b/test/test_eventwebhook.py new file mode 100644 index 000000000..28f9ad282 --- /dev/null +++ b/test/test_eventwebhook.py @@ -0,0 +1,42 @@ +import json +import unittest + +from sendgrid import EventWebhook + + +class UnitTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEDr2LjtURuePQzplybdC+u4CwrqDqBaWjcMMsTbhdbcwHBcepxo7yAQGhHPTnlvFYPAZFceEu/1FwCM/QmGUhA==' + cls.SIGNATURE = 'MEUCIQCtIHJeH93Y+qpYeWrySphQgpNGNr/U+UyUlBkU6n7RAwIgJTz2C+8a8xonZGi6BpSzoQsbVRamr2nlxFDWYNH2j/0=' + cls.TIMESTAMP = '1588788367' + cls.PAYLOAD = json.dumps({ + 'event': 'test_event', + 'category': 'example_payload', + 'message_id': 'message_id', + }, sort_keys=True, separators=(',', ':')) + + def test_verify_valid_signature(self): + ew = EventWebhook() + key = ew.convert_public_key_to_ecdsa(self.PUBLIC_KEY) + self.assertTrue(ew.verify_signature(self.PAYLOAD, self.SIGNATURE, self.TIMESTAMP, key)) + + def test_verify_bad_key(self): + ew = EventWebhook('MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqTxd43gyp8IOEto2LdIfjRQrIbsd4SXZkLW6jDutdhXSJCWHw8REntlo7aNDthvj+y7GjUuFDb/R1NGe1OPzpA==') + self.assertFalse(ew.verify_signature(self.PAYLOAD, self.SIGNATURE, self.TIMESTAMP)) + + def test_verify_bad_payload(self): + ew = EventWebhook(self.PUBLIC_KEY) + self.assertFalse(ew.verify_signature('payload', self.SIGNATURE, self.TIMESTAMP)) + + def test_verify_bad_signature(self): + ew = EventWebhook(self.PUBLIC_KEY) + self.assertFalse(ew.verify_signature( + self.PAYLOAD, + 'MEUCIQCtIHJeH93Y+qpYeWrySphQgpNGNr/U+UyUlBkU6n7RAwIgJTz2C+8a8xonZGi6BpSzoQsbVRamr2nlxFDWYNH3j/0=', + self.TIMESTAMP + )) + + def test_verify_bad_timestamp(self): + ew = EventWebhook(self.PUBLIC_KEY) + self.assertFalse(ew.verify_signature(self.PAYLOAD, self.SIGNATURE, 'timestamp')) From 3415520105dca5973dfbe90b3655252a74d82335 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 17 Jun 2020 11:08:29 -0500 Subject: [PATCH 059/237] feat: add support for dynamic template data to Email class (#908) Fixes https://github.com/sendgrid/sendgrid-python/issues/899 This is helpful when sending multiple emails to multiple recipients. You can now include the dynamic template data with the recipient which will then be included in the personalization. --- .../helpers/mail/dynamic_template_data.py | 12 +-- sendgrid/helpers/mail/email.py | 49 +++++++--- sendgrid/helpers/mail/mail.py | 10 +- sendgrid/helpers/mail/personalization.py | 20 ++-- test/test_mail_helpers.py | 97 +++++++++++++++---- ..._multiple_emails_to_multiple_recipients.md | 23 ++--- 6 files changed, 148 insertions(+), 63 deletions(-) diff --git a/sendgrid/helpers/mail/dynamic_template_data.py b/sendgrid/helpers/mail/dynamic_template_data.py index d682dbf2d..e12967b70 100644 --- a/sendgrid/helpers/mail/dynamic_template_data.py +++ b/sendgrid/helpers/mail/dynamic_template_data.py @@ -5,10 +5,10 @@ class DynamicTemplateData(object): def __init__(self, dynamic_template_data=None, p=0): """Data for a transactional template. - Should be JSON-serializeable structure. + Should be JSON-serializable structure. :param dynamic_template_data: Data for a transactional template. - :type dynamic_template_data: A JSON-serializeable structure + :type dynamic_template_data: A JSON-serializable structure :param name: p is the Personalization object or Personalization object index :type name: Personalization, integer, optional @@ -25,7 +25,7 @@ def __init__(self, dynamic_template_data=None, p=0): def dynamic_template_data(self): """Data for a transactional template. - :rtype: A JSON-serializeable structure + :rtype: A JSON-serializable structure """ return self._dynamic_template_data @@ -34,7 +34,7 @@ def dynamic_template_data(self, value): """Data for a transactional template. :param value: Data for a transactional template. - :type value: A JSON-serializeable structure + :type value: A JSON-serializable structure """ self._dynamic_template_data = value @@ -59,7 +59,7 @@ def personalization(self, value): def __str__(self): """Get a JSON representation of this object. - :rtype: A JSON-serializeable structure + :rtype: A JSON-serializable structure """ return str(self.get()) @@ -68,6 +68,6 @@ def get(self): Get a JSON-ready representation of this DynamicTemplateData object. :returns: Data for a transactional template. - :rtype: A JSON-serializeable structure. + :rtype: A JSON-serializable structure. """ return self.dynamic_template_data diff --git a/sendgrid/helpers/mail/email.py b/sendgrid/helpers/mail/email.py index 3c2cb3bbb..ba3a98848 100644 --- a/sendgrid/helpers/mail/email.py +++ b/sendgrid/helpers/mail/email.py @@ -18,7 +18,7 @@ html_entity_decode = __html_parser__.unescape try: - basestring = basestring + basestring = basestring except NameError: # Define basestring when Python >= 3.0 basestring = str @@ -32,7 +32,8 @@ def __init__(self, name=None, substitutions=None, subject=None, - p=0): + p=0, + dynamic_template_data=None): """Create an Email with the given address and name. Either fill the separate name and email fields, or pass all information @@ -41,17 +42,19 @@ def __init__(self, :type email: string, optional :param name: Name for this sender or recipient. :type name: string, optional + :param substitutions: String substitutions to be applied to the email. + :type substitutions: list(Substitution), optional :param subject: Subject for this sender or recipient. :type subject: string, optional :param p: p is the Personalization object or Personalization object index :type p: Personalization, integer, optional + :param dynamic_template_data: Data for a dynamic transactional template. + :type dynamic_template_data: DynamicTemplateData, optional """ self._name = None self._email = None - self._substitutions = None - self._subject = None - self._personalization = None + self._personalization = p if email and not name: # allows passing emails as "Example Name " @@ -64,14 +67,11 @@ def __init__(self, if name is not None: self.name = name - if substitutions is not None: - self.substitutions = substitutions - - if subject is not None: - self.subject = subject - - if p is not None: - self.personalization = p + # Note that these only apply to To Emails (see Personalization.add_to) + # and should be moved but have not been for compatibility. + self._substitutions = substitutions + self._dynamic_template_data = dynamic_template_data + self._subject = subject @property def name(self): @@ -129,7 +129,7 @@ def email(self, value): @property def substitutions(self): """A list of Substitution objects. These substitutions will apply to - the text and html content of the body of your email, in addition + the text and html content of the body of your email, in addition to the subject and reply-to parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object. @@ -141,13 +141,13 @@ def substitutions(self): @substitutions.setter def substitutions(self, value): """A list of Substitution objects. These substitutions will apply to - the text and html content of the body of your email, in addition to + the text and html content of the body of your email, in addition to the subject and reply-to parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object. :param value: A list of Substitution objects. These substitutions will - apply to the text and html content of the body of your email, in + apply to the text and html content of the body of your email, in addition to the subject and reply-to parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object. @@ -155,6 +155,23 @@ def substitutions(self, value): """ self._substitutions = value + @property + def dynamic_template_data(self): + """Data for a dynamic transactional template. + + :rtype: DynamicTemplateData + """ + return self._dynamic_template_data + + @dynamic_template_data.setter + def dynamic_template_data(self, value): + """Data for a dynamic transactional template. + + :param value: DynamicTemplateData + :type value: DynamicTemplateData + """ + self._dynamic_template_data = value + @property def subject(self): """Subject for this sender or recipient. diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index 5ac3ef800..5d9490ba3 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -185,17 +185,17 @@ def _set_emails( @property def personalizations(self): - """A list of one or more Personaliztion objects + """A list of one or more Personalization objects :rtype: list(Personalization) """ return self._personalizations def add_personalization(self, personalization, index=0): - """Add a Personaliztion object + """Add a Personalization object - :param personalizations: Add a Personalization object - :type personalizations: Personalization + :param personalization: Add a Personalization object + :type personalization: Personalization :param index: The index where to add the Personalization :type index: int """ @@ -627,7 +627,7 @@ def dynamic_template_data(self, value): """Data for a transactional template :param value: Data for a transactional template - :type value: DynamicTemplateData, a JSON-serializeable structure + :type value: DynamicTemplateData, a JSON-serializable structure """ if not isinstance(value, DynamicTemplateData): value = DynamicTemplateData(value) diff --git a/sendgrid/helpers/mail/personalization.py b/sendgrid/helpers/mail/personalization.py index 835933017..9239f9458 100644 --- a/sendgrid/helpers/mail/personalization.py +++ b/sendgrid/helpers/mail/personalization.py @@ -51,11 +51,16 @@ def add_to(self, email): self.add_substitution(substitution) else: self.add_substitution(email.substitutions) + + if email.dynamic_template_data: + self.dynamic_template_data = email.dynamic_template_data + if email.subject: if isinstance(email.subject, str): self.subject = email.subject else: self.subject = email.subject.get() + self._tos.append(email.get()) @property @@ -149,10 +154,10 @@ def add_substitution(self, substitution): :type substitution: Substitution """ - if isinstance(substitution, dict): - self._substitutions.append(substitution) - else: - self._substitutions.append(substitution.get()) + if not isinstance(substitution, dict): + substitution = substitution.get() + + self._substitutions.append(substitution) @property def custom_args(self): @@ -190,14 +195,17 @@ def send_at(self, value): @property def dynamic_template_data(self): """Data for dynamic transactional template. - Should be JSON-serializeable structure. + Should be JSON-serializable structure. - :rtype: JSON-serializeable structure + :rtype: JSON-serializable structure """ return self._dynamic_template_data @dynamic_template_data.setter def dynamic_template_data(self, value): + if not isinstance(value, dict): + value = value.get() + self._dynamic_template_data = value def get(self): diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index b29d8b8c2..fd4f3a68f 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -10,12 +10,11 @@ EmailMessage = message.Message from sendgrid.helpers.mail import ( - Asm, ApiKeyIncludedException, Attachment, BccSettings, - BypassListManagement, Category, ClickTracking, Content, CustomArg, - DynamicTemplateData, Email, FooterSettings, From, Ganalytics, Header, - Mail, MailSettings, OpenTracking, Personalization, SandBoxMode, Section, - SendGridException, SpamCheck, Subject, SubscriptionTracking, Substitution, - TrackingSettings, To, ValidateApiKey + Asm, Attachment, + ClickTracking, Content, + DynamicTemplateData, Email, From, + Mail, Personalization, + Subject, Substitution, To, TrackingSettings ) @@ -210,18 +209,18 @@ def test_multiple_emails_to_multiple_recipients(self): to_emails = [ To(email='test+to0@example.com', - name='Example Name 0', - substitutions=[ - Substitution('-name-', 'Example Name Substitution 0'), - Substitution('-github-', 'https://example.com/test0'), - ], - subject=Subject('Override Global Subject')), + name='Example Name 0', + substitutions=[ + Substitution('-name-', 'Example Name Substitution 0'), + Substitution('-github-', 'https://example.com/test0'), + ], + subject=Subject('Override Global Subject')), To(email='test+to1@example.com', - name='Example Name 1', - substitutions=[ - Substitution('-name-', 'Example Name Substitution 1'), - Substitution('-github-', 'https://example.com/test1'), - ]) + name='Example Name 1', + substitutions=[ + Substitution('-name-', 'Example Name Substitution 1'), + Substitution('-github-', 'https://example.com/test1'), + ]) ] global_substitutions = Substitution('-time-', '2019-01-01 00:00:00') message = Mail( @@ -285,6 +284,70 @@ def test_multiple_emails_to_multiple_recipients(self): }''') ) + def test_dynamic_template_data(self): + self.maxDiff = None + + to_emails = [ + To(email='test+to+0@example.com', + name='Example To 0 Name', + dynamic_template_data=DynamicTemplateData({'name': 'Example 0 Name'})), + To(email='test+to+1@example.com', + name='Example To 1 Name', + dynamic_template_data={'name': 'Example 1 Name'}) + ] + message = Mail( + from_email=From('test@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Hi!'), + plain_text_content='Hello!', + html_content='Hello!', + is_multiple=True) + + self.assertEqual( + message.get(), + json.loads(r'''{ + "content": [ + { + "type": "text/plain", + "value": "Hello!" + }, + { + "type": "text/html", + "value": "Hello!" + } + ], + "from": { + "email": "test@example.com", + "name": "Example From Name" + }, + "personalizations": [ + { + "dynamic_template_data": { + "name": "Example 1 Name" + }, + "to": [ + { + "email": "test+to+1@example.com", + "name": "Example To 1 Name" + } + ] + }, + { + "dynamic_template_data": { + "name": "Example 0 Name" + }, + "to": [ + { + "email": "test+to+0@example.com", + "name": "Example To 0 Name" + } + ] + } + ], + "subject": "Hi!" + }''') + ) + def test_kitchen_sink(self): from sendgrid.helpers.mail import ( Mail, From, To, Cc, Bcc, Subject, Substitution, Header, diff --git a/use_cases/send_multiple_emails_to_multiple_recipients.md b/use_cases/send_multiple_emails_to_multiple_recipients.md index 7217d0a0b..e3085469d 100644 --- a/use_cases/send_multiple_emails_to_multiple_recipients.md +++ b/use_cases/send_multiple_emails_to_multiple_recipients.md @@ -1,33 +1,30 @@ ```python import os -import json from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, To to_emails = [ To(email='test+to0@example.com', name='Example Name 0', - substitutions={ - '-name-': 'Example Name Substitution 0', - '-github-': 'https://example.com/test0', + dynamic_template_data={ + 'name': 'Dynamic Name 0', + 'url': 'https://example.com/test0', }, subject='Override Global Subject'), To(email='test+to1@example.com', name='Example Name 1', - substitutions={ - '-name-': 'Example Name Substitution 1', - '-github-': 'https://example.com/test1', + dynamic_template_data={ + 'name': 'Dynamic Name 1', + 'url': 'https://example.com/test1', }), ] -global_substitutions = {'-time-': '2019-01-01 00:00:00'} message = Mail( from_email=('test+from@example.com', 'Example From Name'), to_emails=to_emails, - subject='Hi -name-, this is the global subject', - html_content='Hello -name-, your URL is ' + - 'here email sent at -time-', - global_substitutions=global_substitutions, + subject='Global subject', is_multiple=True) +message.template_id = 'd-12345678901234567890123456789012' + try: sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) response = sendgrid_client.send(message) @@ -36,4 +33,4 @@ try: print(response.headers) except Exception as e: print(e.message) -``` \ No newline at end of file +``` From 3a001fcdfc17c69759a4c46b1a74ae8af629cda0 Mon Sep 17 00:00:00 2001 From: John Calhoun Date: Tue, 23 Jun 2020 12:02:13 -0700 Subject: [PATCH 060/237] docs: added docstrings to Stats classes (#912) --- sendgrid/helpers/stats/stats.py | 172 +++++++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 5 deletions(-) diff --git a/sendgrid/helpers/stats/stats.py b/sendgrid/helpers/stats/stats.py index 8fe1399a2..b866093b5 100644 --- a/sendgrid/helpers/stats/stats.py +++ b/sendgrid/helpers/stats/stats.py @@ -1,6 +1,14 @@ class Stats(object): + """ + Object for building query params for a global email statistics request + """ def __init__( self, start_date=None): + """Create a Stats object + + :param start_date: Date of when stats should begin in YYYY-MM-DD format, defaults to None + :type start_date: string, optional + """ self._start_date = None self._end_date = None self._aggregated_by = None @@ -14,11 +22,18 @@ def __init__( self.start_date = start_date def __str__(self): + """Get a JSON representation of this object. + + :rtype: string + """ return str(self.get()) def get(self): """ - :return: response stats dict + Get a JSON-ready representation of Stats + + :returns: This GlobalStats, ready for use in a request body. + :rtype: response stats dict """ stats = {} if self.start_date is not None: @@ -39,63 +54,136 @@ def get(self): @property def start_date(self): + """Date of when stats should begin in YYYY-MM-DD format + + :rtype: string + """ return self._start_date @start_date.setter def start_date(self, value): + """Date of when stats should begin in YYYY-MM-DD format + + :param value: Date representing when stats should begin + :type value: string + """ self._start_date = value @property def end_date(self): + """Date of when stats should end in YYYY-MM-DD format + + :rtype: string + """ return self._end_date @end_date.setter def end_date(self, value): + """Date of when stats should end in YYYY-MM-DD format + + :param value: Date representing when stats should end + :type value: string + """ self._end_date = value @property def aggregated_by(self): + """Chosen period (e.g. 'day', 'week', 'month') for how stats get grouped + + :rtype: string + """ return self._aggregated_by @aggregated_by.setter def aggregated_by(self, value): + """Chosen period (e.g. 'day', 'week', 'month') for how stats get grouped + + :param value: Period for how keys will get formatted + :type value: string + """ self._aggregated_by = value @property def sort_by_metric(self): + """Metric to sort stats by + + :rtype: string + """ return self._sort_by_metric @sort_by_metric.setter def sort_by_metric(self, value): + """Metric to sort stats by + + :param value: Chosen metric stats will by sorted by + :type value: string + """ self._sort_by_metric = value @property def sort_by_direction(self): + """Direction data will be sorted, either 'asc' or 'desc' + + :rtype: string + """ return self._sort_by_direction @sort_by_direction.setter def sort_by_direction(self, value): + """Direction data will be sorted, either 'asc' or 'desc' + + :param value: Direction of data, either 'asc' or 'desc' + :type value: string + """ self._sort_by_direction = value @property def limit(self): + """Max amount of results to be returned + + :rtype: int + """ return self._limit @limit.setter def limit(self, value): + """Max amount of results to be returned + + :param value: Max amount of results + :type value: int + """ self._limit = value @property def offset(self): + """Number of places a starting point of a data set will move + + :rtype: int + """ return self._offset @offset.setter def offset(self, value): + """Number of places a starting point of a data set will move + + :param value: Number of positions to move from starting point + :type value: int + """ self._offset = value class CategoryStats(Stats): + """ + object for building query params for a category statistics request + """ def __init__(self, start_date=None, categories=None): + """Create a CategoryStats object + + :param start_date: Date of when stats should begin in YYYY-MM-DD format, defaults to None + :type start_date: string, optional + :param categories: list of categories to get results of, defaults to None + :type categories: list(string), optional + """ self._categories = None super(CategoryStats, self).__init__() @@ -107,7 +195,9 @@ def __init__(self, start_date=None, categories=None): def get(self): """ - :return: response stats dict + Get a JSON-ready representation of this CategoryStats. + + :return: response category stats dict """ stats = {} if self.start_date is not None: @@ -131,16 +221,35 @@ def get(self): @property def categories(self): + """List of categories + + :rtype: list(Category) + """ return self._categories def add_category(self, category): + """Appends a category to this object's category list + + :param category: Category to append to CategoryStats + :type category: Category + """ if self._categories is None: self._categories = [] self._categories.append(category) class SubuserStats(Stats): + """ + object of building query params for a subuser statistics request + """ def __init__(self, start_date=None, subusers=None): + """Create a SubuserStats object + + :param start_date: Date of when stats should begin in YYYY-MM-DD format, defaults to None + :type start_date: string, optional + :param subusers: list of subusers to get results of, defaults to None + :type subusers: list(string), optional + """ self._subusers = None super(SubuserStats, self).__init__() @@ -152,7 +261,9 @@ def __init__(self, start_date=None, subusers=None): def get(self): """ - :return: response stats dict + Get a JSON-ready representation of this SubuserStats. + + :return: response subuser stats dict """ stats = {} if self.start_date is not None: @@ -176,47 +287,98 @@ def get(self): @property def subusers(self): + """List of subusers + + :rtype: list(Subuser) + """ return self._subusers def add_subuser(self, subuser): + """Appends a subuser to this object's subuser list + + :param subuser: Subuser to append to SubuserStats + :type subuser: Subuser + """ if self._subusers is None: self._subusers = [] self._subusers.append(subuser) class Category(object): - + """ + Represents a searchable statistics category to be used in a CategoryStats object + """ def __init__(self, name=None): + """Create a Category object + + :param name: name of category, defaults to None + :type name: string, optional + """ self._name = None if name is not None: self._name = name @property def name(self): + """Get name of category + + :rtype: string + """ return self._name @name.setter def name(self, value): + """Set name of category + + :param value: name of the statistical category + :type value: string + """ self._name = value def get(self): + """ + Get a string representation of Category. + + :return: string of the category's name + """ return self.name class Subuser(object): - + """ + Represents a searchable subuser to be used in a SubuserStats object + """ def __init__(self, name=None): + """Create a Subuser object + + :param name: name of subuser, defaults to None + :type name: string, optional + """ self._name = None if name is not None: self._name = name @property def name(self): + """Get name of the subuser + + :rtype: string + """ return self._name @name.setter def name(self, value): + """Set name of the subuser + + :param value: name of the subuser + :type value: string + """ self._name = value def get(self): + """ + Get a string representation of Subuser. + + :return: string of the subuser's name + """ return self.name From 3d11a2c78cce344024530043f1b2ce269e0970db Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 24 Jun 2020 19:13:36 +0000 Subject: [PATCH 061/237] [Librarian] Version Bump --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4d776082..632f4d24e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-06-24] Version 6.4.0 +-------------------------- +**Library - Docs** +- [PR #912](https://github.com/sendgrid/sendgrid-python/pull/912): added docstrings to Stats classes. Thanks to [@DougCal](https://github.com/DougCal)! + +**Library - Feature** +- [PR #908](https://github.com/sendgrid/sendgrid-python/pull/908): add support for dynamic template data to Email class. Thanks to [@childish-sambino](https://github.com/childish-sambino)! +- [PR #901](https://github.com/sendgrid/sendgrid-python/pull/901): verify signature from event webhook. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + +**Library - Fix** +- [PR #904](https://github.com/sendgrid/sendgrid-python/pull/904): revert "feat: Add equality to Email". Thanks to [@childish-sambino](https://github.com/childish-sambino)! + + [2020-05-27] Version 6.3.2 -------------------------- **Library - Docs** From c0d09c911a510054c61c97ebd4c9105fae478334 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 24 Jun 2020 19:28:18 +0000 Subject: [PATCH 062/237] Release 6.4.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 144bf2f7f..c1170678c 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.3.2' +__version__ = '6.4.0' From 443ee00d046ef59b7fdacc9493f5b5de6cbe1d84 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Wed, 24 Jun 2020 15:09:16 -0700 Subject: [PATCH 063/237] fix: add dependency to install requires (#914) --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1c6c5a8c4..b3eeec82d 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,10 @@ exec(f.read()) def getRequires(): - deps = ['python_http_client>=3.2.1'] + deps = [ + 'python_http_client>=3.2.1', + 'starkbank-ecdsa>=1.0.0' + ] return deps From 53fe422a80563bf0d6d853564aded083adc0121b Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 25 Jun 2020 13:59:24 +0000 Subject: [PATCH 064/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 632f4d24e..52e22ddf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-06-25] Version 6.4.1 +-------------------------- +**Library - Fix** +- [PR #914](https://github.com/sendgrid/sendgrid-python/pull/914): add dependency to install requires. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2020-06-24] Version 6.4.0 -------------------------- **Library - Docs** From 84c31931d0ffd26728aaa40df5d75b1e17aad6c0 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 25 Jun 2020 14:03:50 +0000 Subject: [PATCH 065/237] Release 6.4.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index c1170678c..6594dc237 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.0' +__version__ = '6.4.1' From 67289467bd56073fba261faac347b5c96b1a0156 Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Thu, 25 Jun 2020 16:25:56 +0200 Subject: [PATCH 066/237] docs: document change in top-level dependencies (#915) This change adds information about top-level dependencies of the package to various places of its docs. Follow-up to https://github.com/sendgrid/sendgrid-python/pull/914 --- CONTRIBUTING.md | 1 + FIRST_TIMERS.md | 34 +++++++++++++++++----------------- README.md | 1 + README.rst | 2 ++ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41a454683..306443d08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,6 +75,7 @@ You can use our Docker image to avoid setting up the development environment you - Python 2.7 and 3.4+ - [python_http_client](https://github.com/sendgrid/python-http-client) +- [ecdsa_python](https://github.com/starkbank/ecdsa-python) ##### Initial setup: ##### diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index 714d94bc1..f6d9e4192 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -6,7 +6,7 @@ - [Setting up the Development Environment](#setup) - [Proposing Change through a Pull Request](#pr) - [Be Patient & Wait for reviews](#reviews) - + ### Explore Twilio SendGrid Step 1: Get yourself Access to Twilio SendGrid API Service absolutely free from [here](https://sendgrid.com/free/?source=sendgrid-python)\ @@ -15,8 +15,8 @@ Step 2: Get familiar with Twilio SendGrid Service - Set up your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace [using](https://github.com/sendgrid/sendgrid-python#setup-environment-variables) - Install Twilio SendGrid to your workspace using `pip install sendgrid` - Copy & Run few sample programs from [here](https://github.com/sendgrid/sendgrid-python#hello-email) - - + + ### Raise Issues Twilio SendGrid uses GitHub as the content management service so, all the issues related to the project be it some feature request or a bug report, all are reported at the [GitHub Issue Tracker](https://github.com/sendgrid/sendgrid-python/issues)\ @@ -27,16 +27,16 @@ Step 2: Get familiar with Twilio SendGrid Service If you encounter any sort of bug or abnormal behavior, feel free to inform the community after performing the following checks: - Update to the latest version & check if the bug persists - Check the Issue Tracker for any similar bug report - + Finally fill up the Bug Report Template & Open the Issue highlighting your encountered bug & detailed steps to regenerate the bug. - + ### Setting up the Development Environment - **Using Docker**\ Use our Docker image to avoid setting up the development environment yourself. See [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md) - + - **Setting up Locally**\ - Step 1: Install the Prerequistes: Any Version of Python(2.6 through 3.6) & [python_http_client](https://github.com/sendgrid/python-http-client)\ + Step 1: Install the Prerequistes: Any Version of Python (2.6 through 3.6) and both [python_http_client](https://github.com/sendgrid/python-http-client) and [ecdsa_python](https://github.com/starkbank/ecdsa-python)\ Step 2: Get a local copy of repository using `git clone https://github.com/sendgrid/sendgrid-python.git`\ Step 3: Set your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace using\ `echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env`\ @@ -46,28 +46,28 @@ Step 2: Get familiar with Twilio SendGrid Service - **/examples** contains *Working examples that demonstrate usage* - **/tests** contains *the unit and profiling tests* - **/sendgrid** contains *the Web API v3 client ie sendgrid.py and other files*. - - + + ## Proposing Change through a Pull Request **Step 1:** Fork the project & Clone your fork using `git clone https://github.com//sendgrid-python.git` - + **Step 2:** Reconfigure the remotes using `cd sendgrid-python` and `git remote add upstream https://github.com/sendgrid/sendgrid-python.git` - + **Step 3:** Create a new branch for your modifications using `git checkout -b ` - + **Step 4:** Commit the changes in logical chunks & add commit messages strictly following [this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - + **Step 5:** Run all test locally, [for more info](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#testing) - + **Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream master` - + **Step 7:** Push the topic branch up to your fork using `git push origin ` - + **Step 8:** Open a Pull Request with clear title and description against the master branch. ## Be Patient & Wait for Reviews Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required amendments & changes to the PR as asked. - + ## [Explore New Issues to work upon](https://github.com/sendgrid/sendgrid-python/labels/difficulty%3A%20easy) diff --git a/README.md b/README.md index 09b0ce68c..4e05596e4 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ pip install sendgrid ## Dependencies - [Python-HTTP-Client](https://github.com/sendgrid/python-http-client) +- [ECDSA-Python](https://github.com/starkbank/ecdsa-python) diff --git a/README.rst b/README.rst index 60be5d2af..b0c73aae2 100644 --- a/README.rst +++ b/README.rst @@ -93,6 +93,7 @@ Dependencies ------------ - `Python-HTTP-Client`_ +- `ECDSA-Python`_ Quick Start =========== @@ -272,6 +273,7 @@ License .. _Twilio account: https://www.twilio.com/try-twilio?source=sendgrid-python .. _SENDGRID_API_KEY: https://app.sendgrid.com/settings/api_keys .. _Python-HTTP-Client: https://github.com/sendgrid/python-http-client +.. _ECDSA-Python: https://github.com/starkbank/ecdsa-python .. _/mail/send Helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail .. _personalization object: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html .. _Fluent Interface: https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/ From 91f4cd89aef7e4856706791c99cde460d26011af Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Wed, 1 Jul 2020 11:15:12 -0500 Subject: [PATCH 067/237] docs: update the Docker test integration docs A top-level Dockerfile is now present which can be used to test this repo with prism. --- CONTRIBUTING.md | 110 +++++---------------- docker-test/Dockerfile | 20 ---- docker-test/README.md | 47 --------- docker-test/entrypoint.sh | 17 ---- docker-test/prism.sh | 50 ---------- docker/Dockerfile | 52 ---------- docker/Makefile | 20 ---- docker/README.md | 63 ------------ docker/USAGE.md | 134 -------------------------- docker/docker-compose.yml | 35 ------- docker/entrypoint.sh | 48 --------- docker/env/python-dev/sendgrid-python | 1 - docker/sendgrid.env | 8 -- 13 files changed, 23 insertions(+), 582 deletions(-) delete mode 100644 docker-test/Dockerfile delete mode 100644 docker-test/README.md delete mode 100755 docker-test/entrypoint.sh delete mode 100755 docker-test/prism.sh delete mode 100644 docker/Dockerfile delete mode 100644 docker/Makefile delete mode 100644 docker/README.md delete mode 100644 docker/USAGE.md delete mode 100644 docker/docker-compose.yml delete mode 100755 docker/entrypoint.sh delete mode 160000 docker/env/python-dev/sendgrid-python delete mode 100644 docker/sendgrid.env diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 306443d08..ed57a5722 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,22 +7,14 @@ All third party contributors acknowledge that any contributions they provide wil - [Please use our Bug Report Template](#please-use-our-bug-report-template) - [Improvements to the Codebase](#improvements-to-the-codebase) - [Development Environment](#development-environment) - - [There are two ways to get set up:](#there-are-two-ways-to-get-set-up) - - [1. Using Docker](#1-using-docker) - - [- OR -](#or) - - [2. Install and Run Locally](#2-install-and-run-locally) - - [Prerequisites](#prerequisites) - - [Initial setup:](#initial-setup) - - [Environment Variables](#environment-variables) - - [Execute:](#execute) + - [Prerequisites](#prerequisites) + - [Initial setup](#initial-setup) + - [Environment Variables](#environment-variables) + - [Execute:](#execute) - [Understanding the Code Base](#understanding-the-code-base) - [Testing](#testing) - - [Testing Multiple Versions of Python](#testing-multiple-versions-of-python) - - [Prerequisites:](#prerequisites) - - [Initial setup:](#initial-setup-1) - - [Execute:](#execute-1) - [Style Guidelines & Naming Conventions](#style-guidelines--naming-conventions) -- [Creating a Pull Request](#creating-a-pull-requesta-name%22creating-a-pull-request%22a) +- [Creating a Pull Request](#creating-a-pull-request) - [Code Reviews](#code-reviews) @@ -30,7 +22,6 @@ We use [Milestones](https://github.com/sendgrid/sendgrid-python/milestones) to h There are a few ways to contribute, which we'll enumerate below: - ## Feature Request If you'd like to make a feature request, please read this section. @@ -40,7 +31,6 @@ The GitHub issue tracker is the preferred channel for library feature requests, - Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests. - Please be respectful and considerate of others when commenting on issues - ## Submit a Bug Report Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public. @@ -57,34 +47,28 @@ Before you decide to create a new issue, please try the following: In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md). - ## Improvements to the Codebase We welcome direct contributions to the sendgrid-python code base. Thank you! -### Development Environment ### -#### There are two ways to get set up: #### -#### 1. Using Docker #### -This is usually the easiest and fastest way to get set up. -You can use our Docker image to avoid setting up the development environment yourself. See [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md). +### Development Environment -#### - OR - #### -#### 2. Install and Run Locally #### +#### Prerequisites -##### Prerequisites ##### - -- Python 2.7 and 3.4+ +- Python version 2.7, 3.5, 3.6, 3.7, or 3.8 - [python_http_client](https://github.com/sendgrid/python-http-client) - [ecdsa_python](https://github.com/starkbank/ecdsa-python) +- [pyenv](https://github.com/yyuu/pyenv) +- [tox](https://pypi.python.org/pypi/tox) -##### Initial setup: ##### +#### Initial setup ```bash git clone https://github.com/sendgrid/sendgrid-python.git cd sendgrid-python ``` -### Environment Variables +#### Environment Variables First, get your free Twilio SendGrid account [here](https://sendgrid.com/free?source=sendgrid-python). @@ -101,78 +85,31 @@ Then edit `.env` and insert your API key. source .env ``` -##### Execute: ##### +#### Execute See the [examples folder](https://github.com/sendgrid/sendgrid-python/tree/master/examples) to get started quickly. If testing from the root directory of this repo, create a new file (e.g. test.py) and replace `import sendgrid` with `from sendgrid import *` - ## Understanding the Code Base -**/examples** - -Working examples that demonstrate usage. - -**/tests** - -Currently, we have unit and profiling tests. +- **/examples** + - Working examples that demonstrate usage. +- **/tests** + - Currently, we have unit and profiling tests. +- **/sendgrid** + - The Web API v3 client is `sendgrid.py`, the other files are legacy code for our mail send v2 endpoint. -**/sendgrid** - -The Web API v3 client is `sendgrid.py`, the other files are legacy code for our mail send v2 endpoint. - - ## Testing The PR must pass all the tests before it is reviewed. -All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/test) directory. - -For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](https://github.com/sendgrid/sendgrid-python/tree/master/test/test_sendgrid.py) file with unit tests as you modify the code. - -`python -m unittest discover -v` - -### Testing Multiple Versions of Python - -The PR must pass all the tests before it is reviewed. - -#### Prerequisites: #### - -The above local "Initial setup" is complete +All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/test) directory. For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](https://github.com/sendgrid/sendgrid-python/tree/master/test/test_sendgrid.py) file with unit tests as you modify the code. -* [pyenv](https://github.com/yyuu/pyenv) -* [tox](https://pypi.python.org/pypi/tox) -* [prism](https://github.com/stoplightio/prism) v0.6 - It should be available in your PATH, but unittest script -will try to install it locally if not found. Apart from PATH env variable it will check in `~/bin` and `/usr/local/bin`. -You can install it by yourself in user dir by calling `source test/prism.sh`. +The integration tests require a Twilio SendGrid mock API in order to execute. We've simplified setting this up using Docker to run the tests. You will just need [Docker Desktop](https://docs.docker.com/get-docker/) and `make`. -#### Initial setup: #### - -Add ```eval "$(pyenv init -)"``` to your shell environment (.profile, .bashrc, etc) after installing tox, you only need to do this once. - -``` -pyenv install 2.7.11 -pyenv install 3.4.3 -pyenv install 3.5.0 -``` -Make sure to change the current working directory to your local version of the repo before running the following command: -``` -python setup.py install -``` -``` -pyenv local 3.5.0 3.4.3 2.7.11 -pyenv rehash -``` - -#### Execute: #### - -``` -source venv/bin/activate -tox -``` +Once these are available, simply execute the Docker test target to run all tests: `make test-docker`. This command can also be used to open an interactive shell into the container where this library is installed. To start a *bash* shell for example, use this command: `command=bash make test-docker`. - ## Style Guidelines & Naming Conventions Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning. @@ -185,7 +122,7 @@ Please run your code through: - [pylint](https://www.pylint.org/) - [pep8](https://pypi.python.org/pypi/pep8) -## Creating a Pull Request +## Creating a Pull Request 1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes: @@ -240,6 +177,5 @@ Please run your code through: 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `master` branch. All tests must be passing before we will review the PR. - ## Code Reviews If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, GitHub has some great [information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/). diff --git a/docker-test/Dockerfile b/docker-test/Dockerfile deleted file mode 100644 index d53ac6512..000000000 --- a/docker-test/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM python:3.6-alpine - -WORKDIR /root - -ENV OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json" -ENV SENDGRID_API_KEY $SENDGRID_API_KEY - -RUN apk add --update --no-cache bash curl - -# Install Prism -ADD prism.sh install.sh -RUN sync && bash install.sh - -# Set up default Twilio SendGrid env -RUN mkdir sendgrid-python -COPY entrypoint.sh entrypoint.sh -RUN chmod +x entrypoint.sh - -ENTRYPOINT ["./entrypoint.sh"] -CMD ["--mock"] diff --git a/docker-test/README.md b/docker-test/README.md deleted file mode 100644 index e3163b65d..000000000 --- a/docker-test/README.md +++ /dev/null @@ -1,47 +0,0 @@ -Use Docker to easily test the sendgrid-python library. - -This Docker image contains: - - Python 3.6 - - A running instance of [Stoplight.io's Prism](https://stoplight.io/platform/prism/), which lets you try out the SendGrid API without actually sending email - - A mirrored copy of sendgrid-php so that you may develop locally and then run the tests within the Docker container. - -# Table of Contents - -* [Quick Start](#quick-start) -* [Testing](#testing) -* [Contributing](#contributing) - - -# Quick Start - -1. Clone the sendgrid-python repo - - `git clone https://github.com/sendgrid/sendgrid-python.git` - - `cd sendgrid-python` - - `python setup.py install` -2. [Install Docker](https://docs.docker.com/install/) -3. [Setup local environment variable SENDGRID_API_KEY](https://github.com/sendgrid/sendgrid-php#setup-environment-variables) -4. Build a Docker image, run Docker container, login to the Docker container - - `docker image build --tag="sendgrid/python3.6" ./docker-test` - - `docker run -itd --name="sendgrid_python3.6" -v $(pwd):/root/sendgrid-python sendgrid/python3.6 /bin/bash` -5. Run the tests within the Docker container - - `sudo docker exec -it sendgrid_python3.6 /bin/bash -c 'cd sendgrid-python; python3.6 -m unittest discover -v; exec "${SHELL:-sh}"'` - -Now you can continue development locally, and run `python3.6 -m unittest discover -v` inside of the container to test. - -To clean up the container: `docker stop sendgrid_python3.6 && docker rm sendgrid_python3.6`. - -Happy Hacking! - - -# For Testing the Library (Kick the Tires) - -- After step 5 in the QuickStart, within the Docker container: - - `cd ../` - - `python sendmail.py` - - -# For Contributors - -- Develop per usual locally, but before pushing up to GitHub, you can run the tests locally in the Docker container per step 5 of the quickstart. -- To run all the tests: `python3.6 -m unittest discover -v` -- To run an individual test: `python3.6 -m unittest [Filename].[Class].[TestName]` diff --git a/docker-test/entrypoint.sh b/docker-test/entrypoint.sh deleted file mode 100755 index f41382281..000000000 --- a/docker-test/entrypoint.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash -clear - -if [ "$1" != "--no-mock" ] -then - echo "Starting Prism in mock mode. Calls made to Prism will not actually send emails." - echo "Disable this by running this container with --no-mock." - /prism/bin/prism run --mock --spec $OAI_SPEC_URL 2> /dev/null & -else - echo "Starting Prism in live (--no-mock) mode. Calls made to Prism will send emails." - /prism/bin/prism run --spec $OAI_SPEC_URL 2> /dev/null & -fi - -cd sendgrid-python -python3.6 setup.py install -pip install pyyaml six werkzeug flask python-http-client pytest -exec $SHELL diff --git a/docker-test/prism.sh b/docker-test/prism.sh deleted file mode 100755 index 46acce8c0..000000000 --- a/docker-test/prism.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -set -eu - -install () { - -echo "Installing Prism..." - -UNAME=$(uname) -ARCH=$(uname -m) -if [ "$UNAME" != "Linux" ] && [ "$UNAME" != "Darwin" ] && [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "i686" ]; then - echo "Sorry, OS/Architecture not supported: ${UNAME}/${ARCH}. Download binary from https://github.com/stoplightio/prism/releases" - exit 1 -fi - -if [ "$UNAME" = "Darwin" ] ; then - OSX_ARCH=$(uname -m) - if [ "${OSX_ARCH}" = "x86_64" ] ; then - PLATFORM="darwin_amd64" - fi -elif [ "$UNAME" = "Linux" ] ; then - LINUX_ARCH=$(uname -m) - if [ "${LINUX_ARCH}" = "i686" ] ; then - PLATFORM="linux_386" - elif [ "${LINUX_ARCH}" = "x86_64" ] ; then - PLATFORM="linux_amd64" - fi -fi - -mkdir -p ../prism/bin -#LATEST=$(curl -s https://api.github.com/repos/stoplightio/prism/tags | grep -Eo '"name":.*?[^\\]",' | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2) -LATEST="v0.6.21" -URL="https://github.com/stoplightio/prism/releases/download/$LATEST/prism_$PLATFORM" -DEST=../prism/bin/prism - -if [ -z $LATEST ] ; then - echo "Error requesting. Download binary from ${URL}" - exit 1 -else - curl -L $URL -o $DEST - chmod +x $DEST -fi -} - -if [ -f ../prism/bin/prism ]; then - echo "Prism is already installed." -else - echo "Prism is not installed." - install -fi \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index cf2d36b6b..000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM ubuntu:xenial -ENV PYTHON_VERSIONS='python2.6 python2.7 python3.4 python3.5 python3.6' \ - OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json" - -ARG SENDGRID-PYTHON_VERSION -ARG BRANCH_HTTP_CLIENT - -# install testing versions of python, including old versions, from deadsnakes -RUN set -x \ - && apt-get update \ - && apt-get install -y --no-install-recommends software-properties-common \ - && apt-add-repository -y ppa:fkrull/deadsnakes \ - && apt-get update \ - && apt-get install -y --no-install-recommends $PYTHON_VERSIONS \ - git \ - curl \ - && apt-get purge -y --auto-remove software-properties-common \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /root - -# install Prism -ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh -RUN chmod +x ./install.sh && sync && \ - ./install.sh && \ - rm ./install.sh - -# install pip, tox -ADD https://bootstrap.pypa.io/get-pip.py get-pip.py -RUN python2.7 get-pip.py && \ - python3.6 get-pip.py && \ - pip install tox && \ - rm get-pip.py - -#install pyyaml, six, werkzeug -RUN python3.6 -m pip install pyyaml -RUN python3.6 -m pip install six -RUN python3.6 -m pip install werkzeug -RUN python3.6 -m pip install flask - -# set up default sendgrid env -WORKDIR /root/sources -RUN git clone https://github.com/sendgrid/sendgrid-python.git --branch $SENDGRID-PYTHON_VERSION && \ - git clone https://github.com/sendgrid/python-http-client.git --branch $HTTP-CLIENT_VERSION -WORKDIR /root -RUN ln -s /root/sources/sendgrid-python/sendgrid && \ - ln -s /root/sources/python-http-client/python_http_client - -COPY entrypoint.sh entrypoint.sh -RUN chmod +x entrypoint.sh -ENTRYPOINT ["./entrypoint.sh"] -CMD ["--mock"] diff --git a/docker/Makefile b/docker/Makefile deleted file mode 100644 index 76ccb73af..000000000 --- a/docker/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -stop: - docker-compose stop - -rm: stop - docker-compose stop -fvs - -clean: - docker rmi %(docker images -aq) - -clean_untagged: - docker rmi $(docker images --quiet --filter "dangling=true") 2>/dev/null - -build: - docker-compose up -d - -build-build: - docker-compose up --build -d - -up: rm clean build-build - echo "Sendgrid-python environment is alive :D" diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index d1a187d31..000000000 --- a/docker/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Supported tags and respective `Dockerfile` links - - `v6.1.0`, `latest` [(Dockerfile)](https://github.com/sendgrid/sendgrid-python/blob/master/docker/Dockerfile) - - `v6.0.5` - - `v6.0.3` - - `v6.0.0` - - `v5.6.0` - - `v5.5.0` - - `v5.4.1` - - `v5.4.0` - - `v5.3.0` - - `v5.2.1` - - `v5.2.0` - - `v5.1.0` - - `v5.0.1` - - `v5.0.0` - - `v4.2.1` - - `v4.2.0` - - `v4.1.0` - - `v4.0.0` - - `v3.6.5` - - `v3.6.4` - - `v3.6.3` - - `v3.6.2` - - `v3.3.0` - - `v3.2.3` - - `v3.2.2` - - `v3.2.1` - - `v3.2.0` - -# Quick reference - - **Where to get help:** - [Contact Twilio SendGrid Support](https://support.sendgrid.com/hc/en-us) - - - **Where to file issues:** - https://github.com/sendgrid/sendgrid-python/issues - - - **Where to get more info:** - [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md) - - - **Maintained by:** - [Twilio SendGrid Inc.](https://sendgrid.com) - -# Usage examples - - Most recent version: `docker run -it sendgrid/sendgrid-python`. - - Old version: `docker run -it sendgrid/sendgrid-python:v4.2.0` - - Old version predating this Docker image: - ```sh-session - $ git clone https://github.com/sendgrid/sendgrid-python.git --branch v3.6.1 - $ realpath sendgrid-python - /path/to/sendgrid-python - $ docker run -it -v /path/to/sendgrid-python:/mnt/sendgrid-python sendgrid/sendgrid-python - ``` - - Your own fork: - ```sh-session - $ git clone https://github.com/you/cool-sendgrid-python.git - $ realpath cool-sendgrid-python - /path/to/cool-sendgrid-python - $ docker run -it -v /path/to/cool-sendgrid-python:/mnt/sendgrid-python sendgrid/sendgrid-python - ``` - -For more detailed information, see [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md). - -![Twilio SendGrid Logo](https://sendgrid.com/brand/sg-twilio/SG_Twilio_Lockup_RGBx1.png) diff --git a/docker/USAGE.md b/docker/USAGE.md deleted file mode 100644 index 77a106c9b..000000000 --- a/docker/USAGE.md +++ /dev/null @@ -1,134 +0,0 @@ -You can use Docker to easily try out or test sendgrid-python. - - -# Quickstart - -1. Install Docker on your machine. -2. Run `docker run -it sendgrid/sendgrid-python`. - - -# Info - -This Docker image contains - - `sendgrid-python` and `python-http-client` - - Stoplight's Prism, which lets you try out the API without actually sending email - - `tox` and all supported Python versions, set up to test `sendgrid-python` or your own fork - -Run it in interactive mode with `-it`. - -You can mount repositories in the `/mnt/sendgrid-python` and `/mnt/python-http-client` directories to use them instead of the default SendGrid libraries. Read on for more info. - - -# Options - -## Using an old version - -The easiest way to use an old version is to use an [old tag](https://github.com/sendgrid/sendgrid-python/releases). - -```sh-session -$ docker run -it sendgrid/sendgrid-python:v3.6.1 -``` - -Tags from before this Docker image was created might not exist yet. You may [manually download](#Versions) [old versions](https://github.com/sendgrid/sendgrid-python/releases) in order to use them. - - -## Specifying specific versions - -To use different versions of sendgrid-python or python-http-client - for instance, to replicate your production setup - mount them with the `-v :` option. When you put either repository under `/mnt`, the container will automatically detect it and make the proper symlinks. You can edit these files from the host machine while the container is running. - -For instance, to install sendgrid-python 3.6.1 and use the current python-http-client: - -```sh-session -$ git clone https://github.com/sendgrid/sendgrid-python.git --branch v3.6.1 -$ realpath sendgrid-python -/path/to/sendgrid-python -$ docker run -it -v /path/to/sendgrid-python:/mnt/sendgrid-python sendgrid/sendgrid-python -``` - -To install sendgrid-python v3.6.1 and use an older version of python-http-client: - -```sh-session -$ git clone https://github.com/sendgrid/sendgrid-python.git --branch v3.6.1 -$ realpath sendgrid-python -/path/to/sendgrid-python -$ git clone https://github.com/sendgrid/python-http-client.git --branch v1.2.4 -$ realpath python-http-client -/path/to/python-http-client -$ docker run -it -v /path/to/sendgrid-python:/mnt/sendgrid-python \ -> -v /path/to/python-http-client:/mnt/python-http-client \ -> sendgrid/sendgrid-python -``` - -## Specifying your own fork: - -```sh-session -$ git clone https://github.com/you/cool-sendgrid-python.git -$ realpath cool-sendgrid-python -/path/to/cool-sendgrid-python -$ docker run -it -v /path/to/cool-sendgrid-python:/mnt/sendgrid-python sendgrid/sendgrid-python -``` - -Note that the paths you specify in `-v` must be absolute. - -# Docker Compose - - -# Quickstart - -1. Install docker-compose on your machine. -2. Must copy sendgrid.env to .env file. -3. Edit .env file for your versions and paths. -4. Must create env folder for clone yours repo. -5. Have fun! :D - -## Using tag's for versions - DockerHub: - -### Edit variable TAG on .env/env_sample file - -```sh-session -$ sed -ie 's/TAG=latest/TAG=choice_a_version/g' -``` -### Run service using tags - -```sh-session -$ cd /path/to/sendgrid-python/docker -$ docker-compose up -d sendgrid -``` - -## Specifying specific versions: - -### Edit variable TAG on .env/env_sample file - -```sh-session -$ sed -ie 's/SENDGRID_PYTHON_VERSION=vy.x.z/SENDGRID_PYTHON_VERSION=vx.y.z/g' -$ sed -ie 's/HTTP_CLIENT_VERSION=vy.x.z/HTTP_CLIENT_VERSION=vx.y.z/g' -``` - -### Run service - -```sh-session -$ cd /path/to/sendgrid-python/docker -$ docker-compose up -d sendgrid-dev -``` - -## Specifying your own fork: - -### Edit variable TAG on .env/env_sample file - -```sh-session -$ sed -ie 's/TAG=latest/TAG=choice_a_version/g' -$ sed -ie 's/SENDGRID_PYTHON_VERSION=vy.x.z/SENDGRID_PYTHON_VERSION=vx.y.z/g' -``` - -### Run service - -```sh-session -$ cd /path/to/sendgrid-python/docker -$ docker-compose up -d sendgrid-beta -``` - - -# Testing -Testing is easy! Run the container, `cd sendgrid`, and run `tox`. - -![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index 2a435b39f..000000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: "3.3" - -services: - sendgrid: - image: sendgrid/sendgrid-python:${TAG} - restart: unless-stopped - container_name: sendgrid-prod - tty: true - env_file: - - .env - - sendgrid-dev: - build: - context: . - args: - - SENDGRID-PYTHON_VERSION=${SENDGRID_PYTHON_VERSION} - - HTTP-CLIENT_VERSION=${HTTP_CLIENT_VERSION} - restart: unless-stopped - container_name: sendgrid-dev - tty: true - env_file: - - .env - volumes: - - ${PATH_TO_SENDGRID_PYTHON_DEV}:/mnt/sendgrid-python - - ${PATH_TO_HTTP_CLIENT_DEV}:/mnt/python-http-client - - sendgrid-beta: - image: sendgrid/sendgrid-python:${TAG} - restart: unless-stopped - container_name: sendgrid-beta - tty: true - env_file: - - .env - volumes: - - ${PATH_TO_SENDGRID_PYTHON_FORK}:/root/sources/sendgrid-python/sendgrid diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index 560d80a35..000000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,48 +0,0 @@ -#! /bin/bash -clear - -# check for + link mounted libraries: -if [ -d /mnt/sendgrid-python ] -then - rm /root/sendgrid - ln -s /mnt/sendgrid-python/sendgrid - echo "Linked mounted sendgrid-python's code to /root/sendgrid" -fi -if [ -d /mnt/python_http_client ] -then - rm /root/python_http_client - ln -s /mnt/python-http-client/python_http_client - echo "Linked mounted python-http-client's code to /root/python_http_client" -fi - -SENDGRID_PYTHON_VERSION=$(python2.7 -c 'import sendgrid; print(sendgrid.__version__)') -echo "Welcome to sendgrid-python docker v${SENDGRID_PYTHON_VERSION}." -echo - -if [ "$1" != "--no-mock" ] -then - echo "Starting Prism in mock mode. Calls made to Prism will not actually send emails." - echo "Disable this by running this container with --no-mock." - prism run --mock --spec $OAI_SPEC_URL 2> /dev/null & -else - echo "Starting Prism in live (--no-mock) mode. Calls made to Prism will send emails." - prism run --spec $OAI_SPEC_URL 2> /dev/null & -fi -echo "To use Prism, make API calls to localhost:4010. For example," -echo " sg = sendgrid.SendGridAPIClient(" -echo " host='http://localhost:4010/'," -echo " api_key=os.environ.get('SENDGRID_API_KEY_CAMPAIGNS'))" -echo "To stop Prism, run \"kill $!\" from the shell." - -echo -echo "Starting Python. Type \"import sendgrid\" to get started; return to shell with exit()." -echo - -python2.7 - -echo -echo "To get back into Python, run one of the installed versions:" -echo " $PYTHON_VERSIONS" -echo "To test sendgrid-python, \"cd sendgrid\" and run \"tox\"." -echo -exec $SHELL \ No newline at end of file diff --git a/docker/env/python-dev/sendgrid-python b/docker/env/python-dev/sendgrid-python deleted file mode 160000 index 28cf42f6d..000000000 --- a/docker/env/python-dev/sendgrid-python +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 28cf42f6d590695de7e7ecdedcb67e9d8d4729ac diff --git a/docker/sendgrid.env b/docker/sendgrid.env deleted file mode 100644 index ace58fafa..000000000 --- a/docker/sendgrid.env +++ /dev/null @@ -1,8 +0,0 @@ -TAG=latest -SENDGRID_PYTHON_VERSION="v3.6.1" -HTTP_CLIENT_VERSION="v1.2.4" -PATH_TO_SENDGRID_PYTHON_DEV=../env/python-dev/sendgrid-python -PATH_TO_HTTP_CLIENT_DEV=../env/python-dev/python-http-client -PATH_TO_SENDGRID_PYTHON_PROD=../env/python-prod/sendgrid-python -PATH_TO_HTTP_CLIENT_PROD=../env/python-prod/python-http-client -PATH_TO_SENDGRID_PYTHON_FORK=../env/python-fork/sendgrid-python From df75f6ecc43c79a0a50a1683b602e73f5047d477 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Wed, 1 Jul 2020 11:22:31 -0500 Subject: [PATCH 068/237] fix: drop the silly docker file tests --- test/test_project.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/test_project.py b/test/test_project.py index 27d0befb9..79f27972d 100644 --- a/test/test_project.py +++ b/test/test_project.py @@ -2,16 +2,7 @@ import unittest - class ProjectTests(unittest.TestCase): - # ./docker - def test_docker_dir(self): - self.assertTrue(os.path.isfile("./docker/Dockerfile")) - - # ./docker-compose.yml or ./docker/docker-compose.yml - def test_docker_compose(self): - self.assertTrue(os.path.isfile('./docker/docker-compose.yml')) - # ./.env_sample def test_env(self): self.assertTrue(os.path.isfile('./.env_sample')) From c51b4296d5cdb972c7720713e55bf2b2564895ad Mon Sep 17 00:00:00 2001 From: John Calhoun Date: Tue, 7 Jul 2020 09:24:53 -0700 Subject: [PATCH 069/237] fix: type validation on to_emails parameter on mail object (#920) --- sendgrid/helpers/mail/mail.py | 11 +++-- test/test_mail_helpers.py | 89 +++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index 5d9490ba3..ce8bb2f0c 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -37,7 +37,8 @@ def __init__( :param subject: The subject of the email :type subject: Subject, optional :param to_emails: The email address of the recipient - :type to_emails: To, tuple, optional + :type to_emails: To, str, tuple, list(str), list(tuple), + list(To), optional :param plain_text_content: The plain text body of the email :type plain_text_content: string, optional :param html_content: The html body of the email @@ -239,7 +240,7 @@ def add_to( """Adds a To object to the Personalization object :param to_email: A To object - :type to_email: To, str, tuple + :type to_email: To, str, tuple, list(str), list(tuple), list(To) :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict :param is_multiple: Create a new personalization for each recipient @@ -253,8 +254,12 @@ def add_to( for email in to_email: if isinstance(email, str): email = To(email, None) - if isinstance(email, tuple): + elif isinstance(email, tuple): email = To(email[0], email[1]) + elif not isinstance(email, To): + raise ValueError( + 'Please use a tuple, To, or a str for a to_email list.' + ) self._set_emails(email, global_substitutions, is_multiple, p) else: if isinstance(to_email, str): diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index fd4f3a68f..dff3de5b2 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -284,6 +284,95 @@ def test_multiple_emails_to_multiple_recipients(self): }''') ) + def test_value_error_is_raised_on_to_emails_set_to_list_of_lists(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = [ + ['test+to0@example.com', 'Example To Name 0'], + ['test+to1@example.com', 'Example To Name 1'] + ] + + with self.assertRaises(ValueError): + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + + def test_error_is_not_raised_on_to_emails_set_to_list_of_tuples(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = [ + ('test+to0@example.com', 'Example To Name 0'), + ('test+to1@example.com', 'Example To Name 1') + ] + + try: + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + except: + self.fail('Mail() raised an error on list of tuples') + + def test_error_is_not_raised_on_to_emails_set_to_list_of_strs(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = ['test+to0@example.com', 'test+to1@example.com'] + + try: + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + except: + self.fail('Mail() raised an error on list of strings') + + def test_error_is_not_raised_on_to_emails_set_to_a_str(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = 'test+to0@example.com' + + try: + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + except: + self.fail('Mail() raised an error on a string') + + def test_error_is_not_raised_on_to_emails_set_to_a_tuple(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = ('test+to0@example.com', 'Example To Name 0') + + try: + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + except: + self.fail('Mail() raised an error on a tuple of strings') + def test_dynamic_template_data(self): self.maxDiff = None From 3a69a52d5b35b2c66794b99e3648814bc58c1df0 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 8 Jul 2020 18:32:26 +0000 Subject: [PATCH 070/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52e22ddf6..65cf3e0ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-07-08] Version 6.4.2 +-------------------------- +**Library - Fix** +- [PR #920](https://github.com/sendgrid/sendgrid-python/pull/920): type validation on to_emails parameter on mail object. Thanks to [@DougCal](https://github.com/DougCal)! + +**Library - Docs** +- [PR #915](https://github.com/sendgrid/sendgrid-python/pull/915): document change in top-level dependencies. Thanks to [@honzajavorek](https://github.com/honzajavorek)! + + [2020-06-25] Version 6.4.1 -------------------------- **Library - Fix** From f12689c8d2186faef0d8a9a17ccea3419d9e7114 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 8 Jul 2020 18:52:57 +0000 Subject: [PATCH 071/237] Release 6.4.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 6594dc237..1c98065b4 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.1' +__version__ = '6.4.2' From 50d50d240719a4abb392b8d758ac606f7a1b9aa0 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Fri, 10 Jul 2020 09:22:39 -0700 Subject: [PATCH 072/237] fix: allow general Email type for to_emails (#921) --- sendgrid/helpers/mail/mail.py | 4 +- test/test_mail_helpers.py | 96 +++++++++++++++++++---------------- 2 files changed, 53 insertions(+), 47 deletions(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index ce8bb2f0c..db2399310 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -256,9 +256,9 @@ def add_to( email = To(email, None) elif isinstance(email, tuple): email = To(email[0], email[1]) - elif not isinstance(email, To): + elif not isinstance(email, Email): raise ValueError( - 'Please use a tuple, To, or a str for a to_email list.' + 'Please use a To/Cc/Bcc, tuple, or a str for a to_email list.' ) self._set_emails(email, global_substitutions, is_multiple, p) else: diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index dff3de5b2..202d3948b 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -14,7 +14,7 @@ ClickTracking, Content, DynamicTemplateData, Email, From, Mail, Personalization, - Subject, Substitution, To, TrackingSettings + Subject, Substitution, To, Cc, Bcc, TrackingSettings ) @@ -310,68 +310,74 @@ def test_error_is_not_raised_on_to_emails_set_to_list_of_tuples(self): ('test+to1@example.com', 'Example To Name 1') ] - try: - Mail( - from_email=From('test+from@example.com', 'Example From Name'), - to_emails=to_emails, - subject=Subject('Sending with SendGrid is Fun'), - plain_text_content=PlainTextContent( - 'and easy to do anywhere, even with Python'), - html_content=HtmlContent( - 'and easy to do anywhere, even with Python')) - except: - self.fail('Mail() raised an error on list of tuples') + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) def test_error_is_not_raised_on_to_emails_set_to_list_of_strs(self): from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) self.maxDiff = None to_emails = ['test+to0@example.com', 'test+to1@example.com'] - try: - Mail( - from_email=From('test+from@example.com', 'Example From Name'), - to_emails=to_emails, - subject=Subject('Sending with SendGrid is Fun'), - plain_text_content=PlainTextContent( - 'and easy to do anywhere, even with Python'), - html_content=HtmlContent( - 'and easy to do anywhere, even with Python')) - except: - self.fail('Mail() raised an error on list of strings') + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) def test_error_is_not_raised_on_to_emails_set_to_a_str(self): from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) self.maxDiff = None to_emails = 'test+to0@example.com' - try: - Mail( - from_email=From('test+from@example.com', 'Example From Name'), - to_emails=to_emails, - subject=Subject('Sending with SendGrid is Fun'), - plain_text_content=PlainTextContent( - 'and easy to do anywhere, even with Python'), - html_content=HtmlContent( - 'and easy to do anywhere, even with Python')) - except: - self.fail('Mail() raised an error on a string') + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) def test_error_is_not_raised_on_to_emails_set_to_a_tuple(self): from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) self.maxDiff = None to_emails = ('test+to0@example.com', 'Example To Name 0') - try: - Mail( - from_email=From('test+from@example.com', 'Example From Name'), - to_emails=to_emails, - subject=Subject('Sending with SendGrid is Fun'), - plain_text_content=PlainTextContent( - 'and easy to do anywhere, even with Python'), - html_content=HtmlContent( - 'and easy to do anywhere, even with Python')) - except: - self.fail('Mail() raised an error on a tuple of strings') + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + + def test_error_is_not_raised_on_to_emails_includes_bcc_cc(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = [ + To('test+to0@example.com', 'Example To Name 0'), + Bcc('test+bcc@example.com', 'Example Bcc Name 1'), + Cc('test+cc@example.com', 'Example Cc Name 2') + ] + + Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) def test_dynamic_template_data(self): self.maxDiff = None From ab96abe67c1a389d204f6fe4843c4dcccb192648 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 10 Jul 2020 22:50:30 +0000 Subject: [PATCH 073/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65cf3e0ed..18b4ddc8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-07-10] Version 6.4.3 +-------------------------- +**Library - Fix** +- [PR #921](https://github.com/sendgrid/sendgrid-python/pull/921): allow general email type for to_emails. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2020-07-08] Version 6.4.2 -------------------------- **Library - Fix** From e0a95aeade4e9624bc04bf0fbba4a34fa4ac8388 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 10 Jul 2020 22:54:40 +0000 Subject: [PATCH 074/237] Release 6.4.3 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 1c98065b4..b4818768c 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.2' +__version__ = '6.4.3' From 95890f9ccb58e1163d950d87e4204ccba15e55e3 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 13 Jul 2020 10:24:47 -0500 Subject: [PATCH 075/237] chore: drop the CLA links --- README.md | 1 - README.rst | 2 -- 2 files changed, 3 deletions(-) diff --git a/README.md b/README.md index 4e05596e4..6e453a543 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,6 @@ Quick links: - [Bug Reports](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit-a-bug-report) - [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase) - [Review Pull Requests](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews) -- [Sign the CLA to Create a Pull Request](https://cla.sendgrid.com/sendgrid/sendgrid-python) # Troubleshooting diff --git a/README.rst b/README.rst index b0c73aae2..8d3b4330b 100644 --- a/README.rst +++ b/README.rst @@ -243,7 +243,6 @@ Quick links: - `Bug Reports`_ - `Improvements to the Codebase`_ - `Review Pull Requests`_ -- `Sign the CLA to Create a Pull Request`_ Troubleshooting =============== @@ -294,7 +293,6 @@ License .. _Bug Reports: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit-a-bug-report .. _Improvements to the Codebase: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase .. _Review Pull Requests: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews -.. _Sign the CLA to Create a Pull Request: https://cla.sendgrid.com/sendgrid/sendgrid-python .. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md .. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/master/LICENSE.md From 27ad7692d2c88cf2316574247728afab2306658e Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 13 Jul 2020 10:58:42 -0500 Subject: [PATCH 076/237] chore: drop the local Docker setup link --- FIRST_TIMERS.md | 104 +++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index f6d9e4192..b0636fb81 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -1,73 +1,69 @@ ## Welcome to the Twilio SendGrid Open Source Community - If you are new to Open Source, you are at the right place to start with. Contributions are always encouraged & appreciated. Just follow the organisation's Contribution Policies & you are good to go. - ## How to get Started? - - [Explore Twilio SendGrid](#explore) - - [Raise Issues(If Found Any)](#issues) - - [Setting up the Development Environment](#setup) - - [Proposing Change through a Pull Request](#pr) - - [Be Patient & Wait for reviews](#reviews) - - - ### Explore Twilio SendGrid -Step 1: Get yourself Access to Twilio SendGrid API Service absolutely free from [here](https://sendgrid.com/free/?source=sendgrid-python)\ +If you are new to Open Source, you are at the right place to start with. Contributions are always encouraged & appreciated. Just follow the organisation's Contribution Policies & you are good to go. + +## How to get Started? +- [Explore Twilio SendGrid](#explore) +- [Raise Issues(If Found Any)](#issues) +- [Setting up the Development Environment](#setup) +- [Proposing Change through a Pull Request](#pr) +- [Be Patient & Wait for reviews](#reviews) + + +### Explore Twilio SendGrid +Step 1: Get yourself Access to Twilio SendGrid API Service absolutely free from [here](https://sendgrid.com/free/?source=sendgrid-python) \ Step 2: Get familiar with Twilio SendGrid Service - - Prerequisites are Python version 2.6, 2.7, 3.4, 3.5 or 3.6 - - Set up your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace [using](https://github.com/sendgrid/sendgrid-python#setup-environment-variables) - - Install Twilio SendGrid to your workspace using `pip install sendgrid` - - Copy & Run few sample programs from [here](https://github.com/sendgrid/sendgrid-python#hello-email) - - - - ### Raise Issues - Twilio SendGrid uses GitHub as the content management service so, all the issues related to the project be it some feature request or a bug report, all are reported at the [GitHub Issue Tracker](https://github.com/sendgrid/sendgrid-python/issues)\ - Kindly make sure, to check for any duplicate issues raised by fellow contributors before opening a new issue. Be humble & polite while commenting on issues - - Feature Request\ +- Prerequisites are Python version 2.6, 2.7, 3.4, 3.5 or 3.6 +- Set up your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace [using](https://github.com/sendgrid/sendgrid-python#setup-environment-variables) +- Install Twilio SendGrid to your workspace using `pip install sendgrid` +- Copy & Run few sample programs from [here](https://github.com/sendgrid/sendgrid-python#hello-email) + + +### Raise Issues +Twilio SendGrid uses GitHub as the content management service so, all the issues related to the project be it some feature request or a bug report, all are reported at the [GitHub Issue Tracker](https://github.com/sendgrid/sendgrid-python/issues)\ +Kindly make sure, to check for any duplicate issues raised by fellow contributors before opening a new issue. Be humble & polite while commenting on issues +- Feature Request\ In case you feel like something is missing or lacking in the API Service, feel free to share your views & opinions with the community - - Bug Report\ +- Bug Report\ If you encounter any sort of bug or abnormal behavior, feel free to inform the community after performing the following checks: - - Update to the latest version & check if the bug persists - - Check the Issue Tracker for any similar bug report + - Update to the latest version & check if the bug persists + - Check the Issue Tracker for any similar bug report - Finally fill up the Bug Report Template & Open the Issue highlighting your encountered bug & detailed steps to regenerate the bug. + Finally, fill up the Bug Report Template & Open the Issue highlighting your encountered bug & detailed steps to regenerate the bug. - - ### Setting up the Development Environment - - **Using Docker**\ - Use our Docker image to avoid setting up the development environment yourself. See [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md) - - - **Setting up Locally**\ - Step 1: Install the Prerequistes: Any Version of Python (2.6 through 3.6) and both [python_http_client](https://github.com/sendgrid/python-http-client) and [ecdsa_python](https://github.com/starkbank/ecdsa-python)\ - Step 2: Get a local copy of repository using `git clone https://github.com/sendgrid/sendgrid-python.git`\ - Step 3: Set your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace using\ + +### Setting up the Development Environment +- **Setting up Locally** + - Step 1: Install the Prerequistes: Any Version of Python (2.6 through 3.6) and both [python_http_client](https://github.com/sendgrid/python-http-client) and [ecdsa_python](https://github.com/starkbank/ecdsa-python) + - Step 2: Get a local copy of repository using `git clone https://github.com/sendgrid/sendgrid-python.git` + - Step 3: Set your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace using\ `echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env`\ `echo "sendgrid.env" >> .gitignore`\ - `source ./sendgrid.env`\ - Step 4: The entire codebase consist of 3 major divisions - - **/examples** contains *Working examples that demonstrate usage* - - **/tests** contains *the unit and profiling tests* - - **/sendgrid** contains *the Web API v3 client ie sendgrid.py and other files*. - + `source ./sendgrid.env` + - Step 4: The entire codebase consist of 3 major divisions +- **/examples** contains *Working examples that demonstrate usage* +- **/tests** contains *the unit and profiling tests* +- **/sendgrid** contains *the Web API v3 client ie sendgrid.py and other files*. - - ## Proposing Change through a Pull Request - **Step 1:** Fork the project & Clone your fork using `git clone https://github.com//sendgrid-python.git` + +## Proposing Change through a Pull Request +**Step 1:** Fork the project & Clone your fork using `git clone https://github.com//sendgrid-python.git` - **Step 2:** Reconfigure the remotes using `cd sendgrid-python` and `git remote add upstream https://github.com/sendgrid/sendgrid-python.git` +**Step 2:** Reconfigure the remotes using `cd sendgrid-python` and `git remote add upstream https://github.com/sendgrid/sendgrid-python.git` - **Step 3:** Create a new branch for your modifications using `git checkout -b ` +**Step 3:** Create a new branch for your modifications using `git checkout -b ` - **Step 4:** Commit the changes in logical chunks & add commit messages strictly following [this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) +**Step 4:** Commit the changes in logical chunks & add commit messages strictly following [this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - **Step 5:** Run all test locally, [for more info](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#testing) +**Step 5:** Run all test locally, [for more info](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#testing) - **Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream master` +**Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream master` - **Step 7:** Push the topic branch up to your fork using `git push origin ` +**Step 7:** Push the topic branch up to your fork using `git push origin ` - **Step 8:** Open a Pull Request with clear title and description against the master branch. +**Step 8:** Open a Pull Request with clear title and description against the master branch. - - ## Be Patient & Wait for Reviews - Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required amendments & changes to the PR as asked. + +## Be Patient & Wait for Reviews +Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required amendments & changes to the PR as asked. ## [Explore New Issues to work upon](https://github.com/sendgrid/sendgrid-python/labels/difficulty%3A%20easy) From ab706ce95e84151f4ad966cc1c8876a105381012 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 13 Jul 2020 11:01:32 -0500 Subject: [PATCH 077/237] chore: drop the local Docker setup links --- README.md | 5 ----- README.rst | 2 -- 2 files changed, 7 deletions(-) diff --git a/README.md b/README.md index 6e453a543..9bc604525 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,6 @@ [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors) [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-python/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-python) -**NEW:** - -* Subscribe to email [notifications](https://dx.sendgrid.com/newsletter/python) for releases and breaking changes. -* Quickly get started with [Docker](https://github.com/sendgrid/sendgrid-python/tree/master/docker). - **This library allows you to quickly and easily use the SendGrid Web API v3 via Python.** Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). diff --git a/README.rst b/README.rst index 8d3b4330b..5a2ef9898 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,6 @@ - Subscribe to email `notifications`_ for releases and breaking changes. - Version 6.X release is a BREAKING CHANGE from version 5.X, please see the `release notes`_ for details. -- Quickly get started with `Docker`_. - Send SMS messages with `Twilio`_. This library provides full support for all Twilio SendGrid `Web API v3`_ endpoints, including `v3 /mail/send`_. @@ -261,7 +260,6 @@ License `The MIT License (MIT)`_ .. _notifications: https://dx.sendgrid.com/newsletter/python -.. _Docker: https://github.com/sendgrid/sendgrid-python/tree/master/docker .. _Twilio: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/sms.md .. _release notes: https://github.com/sendgrid/sendgrid-python/releases/tag/v6.0.0 .. _Web API v3: https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html From 03996081ae0a152801a47ad5a452b679622323d8 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Mon, 20 Jul 2020 15:33:37 -0700 Subject: [PATCH 078/237] chore: migrate to new default sendgrid-oai branch (#925) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 356d46682..b176be0a1 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ test-integ: test version ?= latest test-docker: - curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/prism/prism.sh -o prism.sh + curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/prism/prism.sh -o prism.sh version=$(version) bash ./prism.sh clean: nopyc From b3b88d7b409f67a120d5700beade2c09c66d276a Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 22 Jul 2020 19:00:03 +0000 Subject: [PATCH 079/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18b4ddc8d..94ea6ef9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-07-22] Version 6.4.4 +-------------------------- +**Library - Chore** +- [PR #925](https://github.com/sendgrid/sendgrid-python/pull/925): migrate to new default sendgrid-oai branch. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2020-07-10] Version 6.4.3 -------------------------- **Library - Fix** From 2e6f33fd1d731c6f91755f3cf18deab9fccc263e Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 22 Jul 2020 19:19:33 +0000 Subject: [PATCH 080/237] Release 6.4.4 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index b4818768c..e55bc1c67 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.3' +__version__ = '6.4.4' From f010ca8d52e697d7f74274438062e7cd8778b7ca Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Wed, 22 Jul 2020 14:33:44 -0700 Subject: [PATCH 081/237] chore: use HEAD to refer to default branch name --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b176be0a1..620a25993 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ test-integ: test version ?= latest test-docker: - curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/prism/prism.sh -o prism.sh + curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/HEAD/prism/prism.sh -o prism.sh version=$(version) bash ./prism.sh clean: nopyc From d7ee47b56b171e82c20e4dfd9ae5a3f79eb71a85 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Fri, 24 Jul 2020 11:54:56 -0500 Subject: [PATCH 082/237] docs: remove last references of "whitelabel" (#926) * Whitelabel = Sender Authentication * Domain Whitelabel = Domain Authentication * IP Whitelabel = Reverse DNS * Link Whitelabel = Link branding --- USAGE.md | 2073 +++++++++-------- .../senderauthentication.py | 54 +- use_cases/domain_authentication.md | 2 +- 3 files changed, 1066 insertions(+), 1063 deletions(-) diff --git a/USAGE.md b/USAGE.md index 560daea71..b6d044676 100644 --- a/USAGE.md +++ b/USAGE.md @@ -32,14 +32,13 @@ sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) * [PARTNER SETTINGS](#partner-settings) * [SCOPES](#scopes) * [SENDERS](#senders) +* [SENDER AUTHENTICATION](#sender-authentication) * [STATS](#stats) * [SUBUSERS](#subusers) * [SUPPRESSION](#suppression) * [TEMPLATES](#templates) * [TRACKING SETTINGS](#tracking-settings) * [USER](#user) -* [WHITELABEL](#whitelabel) - # ACCESS SETTINGS @@ -1785,7 +1784,7 @@ print(response.headers) **This endpoint allows you to retrieve a list of all assigned and unassigned IPs.** -The response includes warm-up status, pools, assigned subusers, and whitelabel info. The start_date field corresponds to when warmup started for that IP. +The response includes warm-up status, pools, assigned subusers, and authentication info. The start_date field corresponds to when warmup started for that IP. A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. @@ -2854,2184 +2853,2188 @@ print(response.status_code) print(response.body) print(response.headers) ``` - -# STATS - -## Retrieve global email statistics - -**This endpoint allows you to retrieve all of your global email statistics between a given date range.** - -Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. - -### GET /stats + +# SENDER AUTHENTICATION -```python -params = {'aggregated_by': 'day', 'limit': 1, 'start_date': '2016-01-01', 'end_date': '2016-04-01', 'offset': 1} -response = sg.client.stats.get(query_params=params) -print(response.status_code) -print(response.body) -print(response.headers) -``` - -# SUBUSERS +## Create an authenticated domain. -## Create Subuser +**This endpoint allows you to create a domain authentication for one of your domains.** -This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. +If you are creating a domain authentication that you would like a subuser to use, you have two options: +1. Use the "username" parameter. This allows you to create a domain authentication on behalf of your subuser. This means the subuser is able to see and modify the created authentication. +2. Use the Association workflow (see Associate Domain section). This allows you to assign a domain authentication created by the parent to a subuser. This means the subuser will default to the assigned domain authentication, but will not be able to see or modify that authentication. However, if the subuser creates their own domain authentication it will overwrite the assigned domain authentication. -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -### POST /subusers +### POST /whitelabel/domains ```python data = { - "email": "John@example.com", + "automatic_security": False, + "custom_spf": True, + "default": True, + "domain": "example.com", "ips": [ - "1.1.1.1", - "2.2.2.2" + "192.168.1.1", + "192.168.1.2" ], - "password": "johns_password", - "username": "John@example.com" + "subdomain": "news", + "username": "john@example.com" } -response = sg.client.subusers.post(request_body=data) +response = sg.client.whitelabel.domains.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## List all Subusers - -This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. - -For more information about Subusers: - -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) - -### GET /subusers +## List all domain authentications. +**This endpoint allows you to retrieve a list of all domain authentications you have created.** -```python -params = {'username': 'test_string', 'limit': 1, 'offset': 1} -response = sg.client.subusers.get(query_params=params) -print(response.status_code) -print(response.body) -print(response.headers) -``` -## Retrieve Subuser Reputations +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating. +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -This endpoint allows you to request the reputations for your subusers. -### GET /subusers/reputations +### GET /whitelabel/domains ```python -params = {'usernames': 'test_string'} -response = sg.client.subusers.reputations.get(query_params=params) +params = {'username': 'test_string', 'domain': 'test_string', 'exclude_subusers': 'true', 'limit': 1, 'offset': 1} +response = sg.client.whitelabel.domains.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve email statistics for your subusers. +## Get the default domain authentication. -**This endpoint allows you to retrieve the email statistics for the given subusers.** +**This endpoint allows you to retrieve the default default authentication for a domain.** -You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| domain | string |The domain to find a default domain authentication for. | -### GET /subusers/stats +### GET /whitelabel/domains/default ```python -params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1, 'offset': 1, 'start_date': '2016-01-01', 'subusers': 'test_string'} -response = sg.client.subusers.stats.get(query_params=params) +response = sg.client.whitelabel.domains.default.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve monthly stats for all subusers +## List the domain authentication associated with the given user. -**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** +**This endpoint allows you to retrieve all of the domain authentications that have been assigned to a specific subuser.** -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: -`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the default authentication and validate it. The parent may then associate the default authentication via the subuser management tools. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -### GET /subusers/stats/monthly +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| username | string | Username of the subuser to find associated domain authentications for. | + +### GET /whitelabel/domains/subuser ```python -params = {'subuser': 'test_string', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1, 'date': 'test_string', 'sort_by_direction': 'asc'} -response = sg.client.subusers.stats.monthly.get(query_params=params) +response = sg.client.whitelabel.domains.subuser.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve the totals for each email statistic metric for all subusers. +## Disassociate a domain authentication from a given user. -**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** +**This endpoint allows you to disassociate a specific default authentication from a subuser.** +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the default authentication and validate it. The parent may then associate the default authentication via the subuser management tools. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -### GET /subusers/stats/sums +## URI Parameters +| URI Parameter | Type | Required? | Description | +|---|---|---|---| +| username | string | required | Username for the subuser to find associated domain authentications for. | + +### DELETE /whitelabel/domains/subuser ```python -params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1, 'start_date': '2016-01-01', 'sort_by_direction': 'asc'} -response = sg.client.subusers.stats.sums.get(query_params=params) +response = sg.client.whitelabel.domains.subuser.delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Enable/disable a subuser +## Update a domain authentication. -This endpoint allows you to enable or disable a subuser. +**This endpoint allows you to update the settings for a domain authentication.** -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -### PATCH /subusers/{subuser_name} +### PATCH /whitelabel/domains/{domain_id} ```python data = { - "disabled": False + "custom_spf": True, + "default": False } -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).patch(request_body=data) +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a subuser +## Retrieve a domain authentication. -This endpoint allows you to delete a subuser. This is a permanent action, once you delete a subuser it cannot be retrieved. +**This endpoint allows you to retrieve a specific domain authentication.** -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -### DELETE /subusers/{subuser_name} + +### GET /whitelabel/domains/{domain_id} ```python -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).delete() +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Update IPs assigned to a subuser +## Delete a domain authentication. -Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well. +**This endpoint allows you to delete a domain authentication.** -More information: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html) -* [IPs can be whitelabeled](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/ips.html) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) -### PUT /subusers/{subuser_name}/ips +### DELETE /whitelabel/domains/{domain_id} ```python -data = [ - "127.0.0.1" -] -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).ips.put(request_body=data) +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Update Monitor Settings for a subuser +## Associate a domain authentication with a given user. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to associate a specific domain authentication with a subuser.** -### PUT /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the default authentication and validate it. The parent may then associate the default authentication via the subuser management tools. + +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| domain_id | integer | ID of the domain authentication to associate with the subuser. | + +### POST /whitelabel/domains/{domain_id}/subuser ```python data = { - "email": "example@example.com", - "frequency": 500 + "username": "jane@example.com" } -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.put(request_body=data) +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Create monitor settings +## Add an IP to a domain authentication. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to add an IP address to a domain authentication.** -### POST /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| id | integer | ID of the domain to which you are adding an IP | + +### POST /whitelabel/domains/{id}/ips ```python data = { - "email": "example@example.com", - "frequency": 50000 + "ip": "192.168.0.1" } -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.post(request_body=data) +id = "test_url_param" +response = sg.client.whitelabel.domains._(id).ips.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve monitor settings for a subuser +## Remove an IP from a domain authentication. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to remove a domain's IP address from that domain's authentication.** -### GET /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| id | integer | ID of the domain authentication to delete the IP from. | +| ip | string | IP to remove from the domain authentication. | + +### DELETE /whitelabel/domains/{id}/ips/{ip} ```python -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.get() +id = "test_url_param" +ip = "test_url_param" +response = sg.client.whitelabel.domains._(id).ips._(ip).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete monitor settings +## Validate a domain authentication. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to validate a domain authentication. If it fails, it will return an error message describing why the default authentication could not be validated.** -### DELETE /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| id | integer |ID of the domain authentication to validate. | + +### POST /whitelabel/domains/{id}/validate ```python -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.delete() +id = "test_url_param" +response = sg.client.whitelabel.domains._(id).validate.post() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve the monthly email statistics for a single subuser -**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.** +## Create reverse DNS record -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +**This endpoint allows you to create a reverse DNS record.** -When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: -`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +When creating a reverse DNS record, you should use the same subdomain that you used when you created a domain authentication. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -### GET /subusers/{subuser_name}/stats/monthly +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). + +### POST /whitelabel/ips ```python -params = {'date': 'test_string', 'sort_by_direction': 'asc', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1} -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params=params) +data = { + "domain": "example.com", + "ip": "192.168.1.1", + "subdomain": "email" +} +response = sg.client.whitelabel.ips.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` - -# SUPPRESSION -## Retrieve all blocks +## Retrieve all reverse DNS records -**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.** +**This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192."). -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -### GET /suppression/blocks +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). + +### GET /whitelabel/ips ```python -params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} -response = sg.client.suppression.blocks.get(query_params=params) +params = {'ip': 'test_string', 'limit': 1, 'offset': 1} +response = sg.client.whitelabel.ips.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete blocks - -**This endpoint allows you to delete all email addresses on your blocks list.** +## Retrieve a reverse DNS record -There are two options for deleting blocked emails: +**This endpoint allows you to retrieve a reverse DNS record.** -1. You can delete all blocked emails by setting `delete_all` to true in the request body. -2. You can delete some blocked emails by specifying the email addresses in an array in the request body. +A reverse DNS record consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). - -### DELETE /suppression/blocks +### GET /whitelabel/ips/{id} ```python -data = { - "delete_all": False, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -} -response = sg.client.suppression.blocks.delete(request_body=data) +id = "test_url_param" +response = sg.client.whitelabel.ips._(id).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a specific block +## Delete a reverse DNS record -**This endpoint allows you to retrieve a specific email address from your blocks list.** +**This endpoint allows you to delete a reverse DNS record.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +A reverse DNS record consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). -### GET /suppression/blocks/{email} +### DELETE /whitelabel/ips/{id} ```python -email = "test_url_param" -response = sg.client.suppression.blocks._(email).get() +id = "test_url_param" +response = sg.client.whitelabel.ips._(id).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a specific block +## Validate a reverse DNS record -**This endpoint allows you to delete a specific email address from your blocks list.** +**This endpoint allows you to validate a reverse DNS record.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +A reverse DNS record consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). -### DELETE /suppression/blocks/{email} +### POST /whitelabel/ips/{id}/validate ```python -email = "test_url_param" -response = sg.client.suppression.blocks._(email).delete() +id = "test_url_param" +response = sg.client.whitelabel.ips._(id).validate.post() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all bounces - -**This endpoint allows you to retrieve all of your bounces.** +## Create a Link Branding -Bounces are messages that are returned to the server that sent it. +**This endpoint allows you to create a new link branding.** -For more information see: +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### GET /suppression/bounces +### POST /whitelabel/links ```python -params = {'start_time': 1, 'end_time': 1} -response = sg.client.suppression.bounces.get(query_params=params) +data = { + "default": True, + "domain": "example.com", + "subdomain": "mail" +} +params = {'limit': 1, 'offset': 1} +response = sg.client.whitelabel.links.post(request_body=data, query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete bounces - -**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.** - -Bounces are messages that are returned to the server that sent it. +## Retrieve all link brandings -For more information see: +**This endpoint allows you to retrieve all link brandings.** -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes. +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### DELETE /suppression/bounces +### GET /whitelabel/links ```python -data = { - "delete_all": True, - "emails": [ - "example@example.com", - "example2@example.com" - ] -} -response = sg.client.suppression.bounces.delete(request_body=data) +params = {'limit': 1} +response = sg.client.whitelabel.links.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a Bounce +## Retrieve a Default Link Branding -**This endpoint allows you to retrieve a specific bounce for a given email address.** +**This endpoint allows you to retrieve the default link branding.** -Bounces are messages that are returned to the server that sent it. +Default link branding is the actual link branding to be used when sending messages. If there are multiple link brandings, the default is determined by the following order: +
    +
  • Validated link brandings marked as "default"
  • +
  • Legacy link brands (migrated from the whitelabel wizard)
  • +
  • Default Twilio SendGrid link branding (i.e. 100.ct.sendgrid.net)
  • +
-For more information see: +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### GET /suppression/bounces/{email} +### GET /whitelabel/links/default ```python -email = "test_url_param" -response = sg.client.suppression.bounces._(email).get() +params = {'domain': 'test_string'} +response = sg.client.whitelabel.links.default.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a bounce +## Retrieve Associated Link Branding -**This endpoint allows you to remove an email address from your bounce list.** +**This endpoint allows you to retrieve the associated link branding for a subuser.** -Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email address from your bounce list. +Link whitelables can be associated with subusers from the parent account. This functionality allows +subusers to send mail using their parent's link brandings. To associate a link branding, the parent account +must first create a domain authentication and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface. -For more information see: +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### DELETE /suppression/bounces/{email} +### GET /whitelabel/links/subuser ```python -params = {'email_address': 'example@example.com'} -email = "test_url_param" -response = sg.client.suppression.bounces._(email).delete(query_params=params) +params = {'username': 'test_string'} +response = sg.client.whitelabel.links.subuser.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all invalid emails +## Disassociate a Link Branding -**This endpoint allows you to retrieve a list of all invalid email addresses.** +**This endpoint allows you to disassociate a link branding from a subuser.** -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +Link whitelables can be associated with subusers from the parent account. This functionality allows +subusers to send mail using their parent's link brandings. To associate a link branding, the parent account +must first create a domain authentication and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface. -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### GET /suppression/invalid_emails +### DELETE /whitelabel/links/subuser ```python -params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} -response = sg.client.suppression.invalid_emails.get(query_params=params) +params = {'username': 'test_string'} +response = sg.client.whitelabel.links.subuser.delete(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete invalid emails - -**This endpoint allows you to remove email addresses from your invalid email address list.** - -There are two options for deleting invalid email addresses: - -1) You can delete all invalid email addresses by setting `delete_all` to true in the request body. -2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body. +## Update a Link Branding -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to update a specific link branding. You can use this endpoint to change a link branding's default status.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### DELETE /suppression/invalid_emails +### PATCH /whitelabel/links/{id} ```python data = { - "delete_all": False, - "emails": [ - "example1@example.com", - "example2@example.com" - ] + "default": True } -response = sg.client.suppression.invalid_emails.delete(request_body=data) +id = "test_url_param" +response = sg.client.whitelabel.links._(id).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a specific invalid email +## Retrieve a Link Branding -**This endpoint allows you to retrieve a specific invalid email addresses.** - -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to retrieve a specific link branding.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### GET /suppression/invalid_emails/{email} +### GET /whitelabel/links/{id} ```python -email = "test_url_param" -response = sg.client.suppression.invalid_emails._(email).get() +id = "test_url_param" +response = sg.client.whitelabel.links._(id).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a specific invalid email - -**This endpoint allows you to remove a specific email address from the invalid email address list.** +## Delete a Link Branding -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to delete a link branding.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### DELETE /suppression/invalid_emails/{email} +### DELETE /whitelabel/links/{id} ```python -email = "test_url_param" -response = sg.client.suppression.invalid_emails._(email).delete() +id = "test_url_param" +response = sg.client.whitelabel.links._(id).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a specific spam report +## Validate a Link Branding -**This endpoint allows you to retrieve a specific spam report.** +**This endpoint allows you to validate a link branding.** -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### GET /suppression/spam_report/{email} +### POST /whitelabel/links/{id}/validate ```python -email = "test_url_param" -response = sg.client.suppression.spam_report._(email).get() +id = "test_url_param" +response = sg.client.whitelabel.links._(id).validate.post() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a specific spam report +## Associate a Link Branding -**This endpoint allows you to delete a specific spam report.** +**This endpoint allows you to associate a link branding with a subuser account.** -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. +Link whitelables can be associated with subusers from the parent account. This functionality allows +subusers to send mail using their parent's link brandings. To associate a link branding, the parent account +must first create a domain authentication and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +Email link brandings allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -### DELETE /suppression/spam_report/{email} +For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). + +### POST /whitelabel/links/{link_id}/subuser ```python -email = "test_url_param" -response = sg.client.suppression.spam_report._(email).delete() +data = { + "username": "jane@example.com" +} +link_id = "test_url_param" +response = sg.client.whitelabel.links._(link_id).subuser.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all spam reports -**This endpoint allows you to retrieve all spam reports.** + +# STATS -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. +## Retrieve global email statistics -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +**This endpoint allows you to retrieve all of your global email statistics between a given date range.** -### GET /suppression/spam_reports +Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. + +### GET /stats ```python -params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} -response = sg.client.suppression.spam_reports.get(query_params=params) +params = {'aggregated_by': 'day', 'limit': 1, 'start_date': '2016-01-01', 'end_date': '2016-04-01', 'offset': 1} +response = sg.client.stats.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete spam reports - -**This endpoint allows you to delete your spam reports.** + +# SUBUSERS -There are two options for deleting spam reports: +## Create Subuser -1) You can delete all spam reports by setting "delete_all" to true in the request body. -2) You can delete some spam reports by specifying the email addresses in an array in the request body. +This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. +For more information about Subusers: -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) -### DELETE /suppression/spam_reports +### POST /subusers ```python data = { - "delete_all": False, - "emails": [ - "example1@example.com", - "example2@example.com" - ] + "email": "John@example.com", + "ips": [ + "1.1.1.1", + "2.2.2.2" + ], + "password": "johns_password", + "username": "John@example.com" } -response = sg.client.suppression.spam_reports.delete(request_body=data) +response = sg.client.subusers.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all global suppressions +## List all Subusers -**This endpoint allows you to retrieve a list of all email address that are globally suppressed.** +This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. -A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html). +For more information about Subusers: -### GET /suppression/unsubscribes +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) + +### GET /subusers ```python -params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} -response = sg.client.suppression.unsubscribes.get(query_params=params) +params = {'username': 'test_string', 'limit': 1, 'offset': 1} +response = sg.client.subusers.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` - -# TEMPLATES - -## Create a transactional template. - -**This endpoint allows you to create a transactional template.** +## Retrieve Subuser Reputations -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +This endpoint allows you to request the reputations for your subusers. -### POST /templates +### GET /subusers/reputations ```python -data = { - "name": "example_name" -} -response = sg.client.templates.post(request_body=data) +params = {'usernames': 'test_string'} +response = sg.client.subusers.reputations.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all transactional templates. +## Retrieve email statistics for your subusers. -**This endpoint allows you to retrieve all transactional templates.** +**This endpoint allows you to retrieve the email statistics for the given subusers.** -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. -### GET /templates +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). + +### GET /subusers/stats ```python -response = sg.client.templates.get() +params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1, 'offset': 1, 'start_date': '2016-01-01', 'subusers': 'test_string'} +response = sg.client.subusers.stats.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Edit a transactional template. +## Retrieve monthly stats for all subusers -**This endpoint allows you to edit a transactional template.** +**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: +`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). -### PATCH /templates/{template_id} +### GET /subusers/stats/monthly ```python -data = { - "name": "new_example_name" -} -template_id = "test_url_param" -response = sg.client.templates._(template_id).patch(request_body=data) +params = {'subuser': 'test_string', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1, 'date': 'test_string', 'sort_by_direction': 'asc'} +response = sg.client.subusers.stats.monthly.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a single transactional template. +## Retrieve the totals for each email statistic metric for all subusers. -**This endpoint allows you to retrieve a single transactional template.** +**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). -### GET /templates/{template_id} +### GET /subusers/stats/sums ```python -template_id = "test_url_param" -response = sg.client.templates._(template_id).get() +params = {'end_date': '2016-04-01', 'aggregated_by': 'day', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1, 'start_date': '2016-01-01', 'sort_by_direction': 'asc'} +response = sg.client.subusers.stats.sums.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a template. - -**This endpoint allows you to delete a transactional template.** +## Enable/disable a subuser -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +This endpoint allows you to enable or disable a subuser. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +For more information about Subusers: +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) -### DELETE /templates/{template_id} +### PATCH /subusers/{subuser_name} ```python -template_id = "test_url_param" -response = sg.client.templates._(template_id).delete() +data = { + "disabled": False +} +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Create a new transactional template version. +## Delete a subuser -**This endpoint allows you to create a new version of a template.** +This endpoint allows you to delete a subuser. This is a permanent action, once you delete a subuser it cannot be retrieved. -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +For more information about Subusers: -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +### DELETE /subusers/{subuser_name} -### POST /templates/{template_id}/versions + +```python +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).delete() +print(response.status_code) +print(response.body) +print(response.headers) +``` +## Update IPs assigned to a subuser + +Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well. + +More information: + +* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html) +* [How to set up reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) + +### PUT /subusers/{subuser_name}/ips ```python -data = { - "active": 1, - "html_content": "<%body%>", - "name": "example_version_name", - "plain_content": "<%body%>", - "subject": "<%subject%>", - "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" -} -template_id = "test_url_param" -response = sg.client.templates._(template_id).versions.post(request_body=data) +data = [ + "127.0.0.1" +] +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).ips.put(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Edit a transactional template version. +## Update Monitor Settings for a subuser -**This endpoint allows you to edit a version of one of your transactional templates.** +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +### PUT /subusers/{subuser_name}/monitor -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +```python +data = { + "email": "example@example.com", + "frequency": 500 +} +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.put(request_body=data) +print(response.status_code) +print(response.body) +print(response.headers) +``` +## Create monitor settings -### PATCH /templates/{template_id}/versions/{version_id} +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. + +### POST /subusers/{subuser_name}/monitor ```python data = { - "active": 1, - "html_content": "<%body%>", - "name": "updated_example_name", - "plain_content": "<%body%>", - "subject": "<%subject%>" + "email": "example@example.com", + "frequency": 50000 } -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).patch(request_body=data) +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a specific transactional template version. +## Retrieve monitor settings for a subuser -**This endpoint allows you to retrieve a specific version of a template.** +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +### GET /subusers/{subuser_name}/monitor -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +```python +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.get() +print(response.status_code) +print(response.body) +print(response.headers) +``` +## Delete monitor settings -### GET /templates/{template_id}/versions/{version_id} +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. + +### DELETE /subusers/{subuser_name}/monitor ```python -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).get() +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a transactional template version. +## Retrieve the monthly email statistics for a single subuser -**This endpoint allows you to delete one of your transactional template versions.** +**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.** -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: +`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). -### DELETE /templates/{template_id}/versions/{version_id} +### GET /subusers/{subuser_name}/stats/monthly ```python -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).delete() +params = {'date': 'test_string', 'sort_by_direction': 'asc', 'limit': 1, 'sort_by_metric': 'test_string', 'offset': 1} +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Activate a transactional template version. - -**This endpoint allows you to activate a version of one of your templates.** + +# SUPPRESSION -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +## Retrieve all blocks +**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.** -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### POST /templates/{template_id}/versions/{version_id}/activate +### GET /suppression/blocks ```python -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).activate.post() +params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} +response = sg.client.suppression.blocks.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` - -# TRACKING SETTINGS +## Delete blocks -## Retrieve Tracking Settings +**This endpoint allows you to delete all email addresses on your blocks list.** -**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.** +There are two options for deleting blocked emails: -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +1. You can delete all blocked emails by setting `delete_all` to true in the request body. +2. You can delete some blocked emails by specifying the email addresses in an array in the request body. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -### GET /tracking_settings +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). + +### DELETE /suppression/blocks ```python -params = {'limit': 1, 'offset': 1} -response = sg.client.tracking_settings.get(query_params=params) +data = { + "delete_all": False, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +} +response = sg.client.suppression.blocks.delete(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Update Click Tracking Settings +## Retrieve a specific block -**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.** +**This endpoint allows you to retrieve a specific email address from your blocks list.** -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### PATCH /tracking_settings/click +### GET /suppression/blocks/{email} ```python -data = { - "enabled": True -} -response = sg.client.tracking_settings.click.patch(request_body=data) +email = "test_url_param" +response = sg.client.suppression.blocks._(email).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve Click Track Settings +## Delete a specific block -**This endpoint allows you to retrieve your current click tracking setting.** +**This endpoint allows you to delete a specific email address from your blocks list.** -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### GET /tracking_settings/click +### DELETE /suppression/blocks/{email} ```python -response = sg.client.tracking_settings.click.get() +email = "test_url_param" +response = sg.client.suppression.blocks._(email).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Update Google Analytics Settings - -**This endpoint allows you to update your current setting for Google Analytics.** +## Retrieve all bounces -For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). +**This endpoint allows you to retrieve all of your bounces.** -We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). +Bounces are messages that are returned to the server that sent it. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information see: -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -### PATCH /tracking_settings/google_analytics +### GET /suppression/bounces ```python -data = { - "enabled": True, - "utm_campaign": "website", - "utm_content": "", - "utm_medium": "email", - "utm_source": "sendgrid.com", - "utm_term": "" -} -response = sg.client.tracking_settings.google_analytics.patch(request_body=data) +params = {'start_time': 1, 'end_time': 1} +response = sg.client.suppression.bounces.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve Google Analytics Settings +## Delete bounces -**This endpoint allows you to retrieve your current setting for Google Analytics.** +**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.** -For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). +Bounces are messages that are returned to the server that sent it. -We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). +For more information see: -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes. -### GET /tracking_settings/google_analytics +### DELETE /suppression/bounces ```python -response = sg.client.tracking_settings.google_analytics.get() +data = { + "delete_all": True, + "emails": [ + "example@example.com", + "example2@example.com" + ] +} +response = sg.client.suppression.bounces.delete(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Update Open Tracking Settings +## Retrieve a Bounce -**This endpoint allows you to update your current settings for open tracking.** +**This endpoint allows you to retrieve a specific bounce for a given email address.** -Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +Bounces are messages that are returned to the server that sent it. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information see: -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -### PATCH /tracking_settings/open +### GET /suppression/bounces/{email} ```python -data = { - "enabled": True -} -response = sg.client.tracking_settings.open.patch(request_body=data) +email = "test_url_param" +response = sg.client.suppression.bounces._(email).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Get Open Tracking Settings +## Delete a bounce -**This endpoint allows you to retrieve your current settings for open tracking.** +**This endpoint allows you to remove an email address from your bounce list.** -Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email address from your bounce list. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information see: -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -### GET /tracking_settings/open +### DELETE /suppression/bounces/{email} ```python -response = sg.client.tracking_settings.open.get() +params = {'email_address': 'example@example.com'} +email = "test_url_param" +response = sg.client.suppression.bounces._(email).delete(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Update Subscription Tracking Settings +## Retrieve all invalid emails -**This endpoint allows you to update your current settings for subscription tracking.** +**This endpoint allows you to retrieve a list of all invalid email addresses.** -Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). -### PATCH /tracking_settings/subscription +### GET /suppression/invalid_emails ```python -data = { - "enabled": True, - "html_content": "html content", - "landing": "landing page html", - "plain_content": "text content", - "replace": "replacement tag", - "url": "url" -} -response = sg.client.tracking_settings.subscription.patch(request_body=data) +params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} +response = sg.client.suppression.invalid_emails.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve Subscription Tracking Settings +## Delete invalid emails -**This endpoint allows you to retrieve your current settings for subscription tracking.** +**This endpoint allows you to remove email addresses from your invalid email address list.** -Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +There are two options for deleting invalid email addresses: -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +1) You can delete all invalid email addresses by setting `delete_all` to true in the request body. +2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -### GET /tracking_settings/subscription +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. + +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). + +### DELETE /suppression/invalid_emails ```python -response = sg.client.tracking_settings.subscription.get() +data = { + "delete_all": False, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +} +response = sg.client.suppression.invalid_emails.delete(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` - -# USER - -## Get a user's account information. - -**This endpoint allows you to retrieve your user account details.** +## Retrieve a specific invalid email -Your user's account information includes the user's account type and reputation. +**This endpoint allows you to retrieve a specific invalid email addresses.** -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -For more information about your user profile: +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. -* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). -### GET /user/account +### GET /suppression/invalid_emails/{email} ```python -response = sg.client.user.account.get() +email = "test_url_param" +response = sg.client.suppression.invalid_emails._(email).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve your credit balance +## Delete a specific invalid email -**This endpoint allows you to retrieve the current credit balance for your account.** +**This endpoint allows you to remove a specific email address from the invalid email address list.** -Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html). +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -### GET /user/credits +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. + +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). + +### DELETE /suppression/invalid_emails/{email} ```python -response = sg.client.user.credits.get() +email = "test_url_param" +response = sg.client.suppression.invalid_emails._(email).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Update your account email address - -**This endpoint allows you to update the email address currently on file for your account.** +## Retrieve a specific spam report -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +**This endpoint allows you to retrieve a specific spam report.** -For more information about your user profile: +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### PUT /user/email +### GET /suppression/spam_report/{email} ```python -data = { - "email": "example@example.com" -} -response = sg.client.user.email.put(request_body=data) +email = "test_url_param" +response = sg.client.suppression.spam_report._(email).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve your account email address - -**This endpoint allows you to retrieve the email address currently on file for your account.** +## Delete a specific spam report -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +**This endpoint allows you to delete a specific spam report.** -For more information about your user profile: +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### GET /user/email +### DELETE /suppression/spam_report/{email} ```python -response = sg.client.user.email.get() +email = "test_url_param" +response = sg.client.suppression.spam_report._(email).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Update your password - -**This endpoint allows you to update your password.** +## Retrieve all spam reports -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +**This endpoint allows you to retrieve all spam reports.** -For more information about your user profile: +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### PUT /user/password +### GET /suppression/spam_reports ```python -data = { - "new_password": "new_password", - "old_password": "old_password" -} -response = sg.client.user.password.put(request_body=data) +params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} +response = sg.client.suppression.spam_reports.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Update a user's profile +## Delete spam reports -**This endpoint allows you to update your current profile details.** +**This endpoint allows you to delete your spam reports.** -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +There are two options for deleting spam reports: -For more information about your user profile: +1) You can delete all spam reports by setting "delete_all" to true in the request body. +2) You can delete some spam reports by specifying the email addresses in an array in the request body. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to Twilio SendGrid. -It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH. +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### PATCH /user/profile +### DELETE /suppression/spam_reports ```python data = { - "city": "Orange", - "first_name": "Example", - "last_name": "User" + "delete_all": False, + "emails": [ + "example1@example.com", + "example2@example.com" + ] } -response = sg.client.user.profile.patch(request_body=data) +response = sg.client.suppression.spam_reports.delete(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Get a user's profile - -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +## Retrieve all global suppressions -For more information about your user profile: +**This endpoint allows you to retrieve a list of all email address that are globally suppressed.** -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html). -### GET /user/profile +### GET /suppression/unsubscribes ```python -response = sg.client.user.profile.get() +params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1} +response = sg.client.suppression.unsubscribes.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Cancel or pause a scheduled send + +# TEMPLATES -**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.** +## Create a transactional template. -If the maximum number of cancellations/pauses are added, HTTP 400 will -be returned. +**This endpoint allows you to create a transactional template.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -### POST /user/scheduled_sends +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). + +### POST /templates ```python data = { - "batch_id": "YOUR_BATCH_ID", - "status": "pause" + "name": "example_name" } -response = sg.client.user.scheduled_sends.post(request_body=data) +response = sg.client.templates.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all scheduled sends +## Retrieve all transactional templates. -**This endpoint allows you to retrieve all cancel/paused scheduled send information.** +**This endpoint allows you to retrieve all transactional templates.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -### GET /user/scheduled_sends +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). + +### GET /templates ```python -response = sg.client.user.scheduled_sends.get() +response = sg.client.templates.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Update user scheduled send information +## Edit a transactional template. -**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** +**This endpoint allows you to edit a transactional template.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -### PATCH /user/scheduled_sends/{batch_id} +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). + + +### PATCH /templates/{template_id} ```python data = { - "status": "pause" + "name": "new_example_name" } -batch_id = "test_url_param" -response = sg.client.user.scheduled_sends._(batch_id).patch(request_body=data) +template_id = "test_url_param" +response = sg.client.templates._(template_id).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve scheduled send - -**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** - -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. - -### GET /user/scheduled_sends/{batch_id} +## Retrieve a single transactional template. +**This endpoint allows you to retrieve a single transactional template.** -```python -batch_id = "test_url_param" -response = sg.client.user.scheduled_sends._(batch_id).get() -print(response.status_code) -print(response.body) -print(response.headers) -``` -## Delete a cancellation or pause of a scheduled send +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -**This endpoint allows you to delete the cancellation/pause of a scheduled send.** +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### DELETE /user/scheduled_sends/{batch_id} +### GET /templates/{template_id} ```python -batch_id = "test_url_param" -response = sg.client.user.scheduled_sends._(batch_id).delete() +template_id = "test_url_param" +response = sg.client.templates._(template_id).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Update Enforced TLS settings +## Delete a template. -**This endpoint allows you to update your current Enforced TLS settings.** +**This endpoint allows you to delete a transactional template.** -The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### PATCH /user/settings/enforced_tls + +### DELETE /templates/{template_id} ```python -data = { - "require_tls": True, - "require_valid_cert": False -} -response = sg.client.user.settings.enforced_tls.patch(request_body=data) +template_id = "test_url_param" +response = sg.client.templates._(template_id).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve current Enforced TLS settings. +## Create a new transactional template version. -**This endpoint allows you to retrieve your current Enforced TLS settings.** +**This endpoint allows you to create a new version of a template.** -The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### GET /user/settings/enforced_tls + +### POST /templates/{template_id}/versions ```python -response = sg.client.user.settings.enforced_tls.get() +data = { + "active": 1, + "html_content": "<%body%>", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" +} +template_id = "test_url_param" +response = sg.client.templates._(template_id).versions.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Update your username +## Edit a transactional template version. -**This endpoint allows you to update the username for your account.** +**This endpoint allows you to edit a version of one of your transactional templates.** -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -For more information about your user profile: +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | -### PUT /user/username +### PATCH /templates/{template_id}/versions/{version_id} ```python data = { - "username": "test_username" + "active": 1, + "html_content": "<%body%>", + "name": "updated_example_name", + "plain_content": "<%body%>", + "subject": "<%subject%>" } -response = sg.client.user.username.put(request_body=data) +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve your username +## Retrieve a specific transactional template version. -**This endpoint allows you to retrieve your current account username.** +**This endpoint allows you to retrieve a specific version of a template.** -Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -For more information about your user profile: +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | -### GET /user/username +### GET /templates/{template_id}/versions/{version_id} ```python -response = sg.client.user.username.get() +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Update Event Notification Settings +## Delete a transactional template version. -**This endpoint allows you to update your current event webhook settings.** +**This endpoint allows you to delete one of your transactional template versions.** -If an event type is marked as `true`, then the event webhook will include information about that event. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email. +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | -### PATCH /user/webhooks/event/settings +### DELETE /templates/{template_id}/versions/{version_id} ```python -data = { - "bounce": True, - "click": True, - "deferred": True, - "delivered": True, - "dropped": True, - "enabled": True, - "group_resubscribe": True, - "group_unsubscribe": True, - "open": True, - "processed": True, - "spam_report": True, - "unsubscribe": True, - "url": "url" -} -response = sg.client.user.webhooks.event.settings.patch(request_body=data) +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve Event Webhook settings +## Activate a transactional template version. -**This endpoint allows you to retrieve your current event webhook settings.** +**This endpoint allows you to activate a version of one of your templates.** -If an event type is marked as `true`, then the event webhook will include information about that event. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email. -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### GET /user/webhooks/event/settings +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | + +### POST /templates/{template_id}/versions/{version_id}/activate ```python -response = sg.client.user.webhooks.event.settings.get() +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).activate.post() print(response.status_code) print(response.body) print(response.headers) ``` -## Test Event Notification Settings + +# TRACKING SETTINGS -**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.** +## Retrieve Tracking Settings -Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email. +**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.** -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -### POST /user/webhooks/event/test +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### GET /tracking_settings ```python -data = { - "url": "url" -} -response = sg.client.user.webhooks.event.test.post(request_body=data) +params = {'limit': 1, 'offset': 1} +response = sg.client.tracking_settings.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) ``` -## Create a parse setting +## Update Click Tracking Settings + +**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.** -**This endpoint allows you to create a new inbound parse setting.** +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### POST /user/webhooks/parse/settings +### PATCH /tracking_settings/click ```python data = { - "hostname": "myhostname.com", - "send_raw": False, - "spam_check": True, - "url": "http://email.myhosthame.com" + "enabled": True } -response = sg.client.user.webhooks.parse.settings.post(request_body=data) +response = sg.client.tracking_settings.click.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all parse settings +## Retrieve Click Track Settings -**This endpoint allows you to retrieve all of your current inbound parse settings.** +**This endpoint allows you to retrieve your current click tracking setting.** -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -### GET /user/webhooks/parse/settings +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### GET /tracking_settings/click ```python -response = sg.client.user.webhooks.parse.settings.get() +response = sg.client.tracking_settings.click.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Update a parse setting +## Update Google Analytics Settings -**This endpoint allows you to update a specific inbound parse setting.** +**This endpoint allows you to update your current setting for Google Analytics.** -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). -### PATCH /user/webhooks/parse/settings/{hostname} +We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). + +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. + +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### PATCH /tracking_settings/google_analytics ```python data = { - "send_raw": True, - "spam_check": False, - "url": "http://newdomain.com/parse" + "enabled": True, + "utm_campaign": "website", + "utm_content": "", + "utm_medium": "email", + "utm_source": "sendgrid.com", + "utm_term": "" } -hostname = "test_url_param" -response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body=data) +response = sg.client.tracking_settings.google_analytics.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a specific parse setting - -**This endpoint allows you to retrieve a specific inbound parse setting.** - -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +## Retrieve Google Analytics Settings -### GET /user/webhooks/parse/settings/{hostname} +**This endpoint allows you to retrieve your current setting for Google Analytics.** +For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). -```python -hostname = "test_url_param" -response = sg.client.user.webhooks.parse.settings._(hostname).get() -print(response.status_code) -print(response.body) -print(response.headers) -``` -## Delete a parse setting +We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). -**This endpoint allows you to delete a specific inbound parse setting.** +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### DELETE /user/webhooks/parse/settings/{hostname} +### GET /tracking_settings/google_analytics ```python -hostname = "test_url_param" -response = sg.client.user.webhooks.parse.settings._(hostname).delete() +response = sg.client.tracking_settings.google_analytics.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieves Inbound Parse Webhook statistics. +## Update Open Tracking Settings -**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** +**This endpoint allows you to update your current settings for open tracking.** -Twilio SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments. +Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. -There are a number of pre-made integrations for the Twilio SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -### GET /user/webhooks/parse/stats +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### PATCH /tracking_settings/open ```python -params = {'aggregated_by': 'day', 'limit': 'test_string', 'start_date': '2016-01-01', 'end_date': '2016-04-01', 'offset': 'test_string'} -response = sg.client.user.webhooks.parse.stats.get(query_params=params) +data = { + "enabled": True +} +response = sg.client.tracking_settings.open.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` - -# WHITELABEL - -## Create a domain whitelabel. +## Get Open Tracking Settings -**This endpoint allows you to create a whitelabel for one of your domains.** +**This endpoint allows you to retrieve your current settings for open tracking.** -If you are creating a domain whitelabel that you would like a subuser to use, you have two options: -1. Use the "username" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser is able to see and modify the created whitelabel. -2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their own whitelabel it will overwrite the assigned whitelabel. +Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### POST /whitelabel/domains +### GET /tracking_settings/open ```python -data = { - "automatic_security": False, - "custom_spf": True, - "default": True, - "domain": "example.com", - "ips": [ - "192.168.1.1", - "192.168.1.2" - ], - "subdomain": "news", - "username": "john@example.com" -} -response = sg.client.whitelabel.domains.post(request_body=data) +response = sg.client.tracking_settings.open.get() print(response.status_code) print(response.body) print(response.headers) ``` -## List all domain whitelabels. +## Update Subscription Tracking Settings -**This endpoint allows you to retrieve a list of all domain whitelabels you have created.** +**This endpoint allows you to update your current settings for subscription tracking.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### GET /whitelabel/domains +### PATCH /tracking_settings/subscription ```python -params = {'username': 'test_string', 'domain': 'test_string', 'exclude_subusers': 'true', 'limit': 1, 'offset': 1} -response = sg.client.whitelabel.domains.get(query_params=params) +data = { + "enabled": True, + "html_content": "html content", + "landing": "landing page html", + "plain_content": "text content", + "replace": "replacement tag", + "url": "url" +} +response = sg.client.tracking_settings.subscription.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Get the default domain whitelabel. +## Retrieve Subscription Tracking Settings -**This endpoint allows you to retrieve the default whitelabel for a domain.** +**This endpoint allows you to retrieve your current settings for subscription tracking.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| domain | string |The domain to find a default domain whitelabel for. | +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### GET /whitelabel/domains/default +### GET /tracking_settings/subscription ```python -response = sg.client.whitelabel.domains.default.get() +response = sg.client.tracking_settings.subscription.get() print(response.status_code) print(response.body) print(response.headers) ``` -## List the domain whitelabel associated with the given user. + +# USER -**This endpoint allows you to retrieve all of the whitelabels that have been assigned to a specific subuser.** +## Get a user's account information. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +**This endpoint allows you to retrieve your user account details.** -Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. +Your user's account information includes the user's account type and reputation. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| username | string | Username of the subuser to find associated whitelabels for. | +For more information about your user profile: -### GET /whitelabel/domains/subuser +* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### GET /user/account ```python -response = sg.client.whitelabel.domains.subuser.get() +response = sg.client.user.account.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Disassociate a domain whitelabel from a given user. - -**This endpoint allows you to disassociate a specific whitelabel from a subuser.** - -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. - -Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. +## Retrieve your credit balance -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +**This endpoint allows you to retrieve the current credit balance for your account.** -## URI Parameters -| URI Parameter | Type | Required? | Description | -|---|---|---|---| -| username | string | required | Username for the subuser to find associated whitelabels for. | +Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html). -### DELETE /whitelabel/domains/subuser +### GET /user/credits ```python -response = sg.client.whitelabel.domains.subuser.delete() +response = sg.client.user.credits.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Update a domain whitelabel. +## Update your account email address -**This endpoint allows you to update the settings for a domain whitelabel.** +**This endpoint allows you to update the email address currently on file for your account.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about your user profile: -### PATCH /whitelabel/domains/{domain_id} +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### PUT /user/email ```python data = { - "custom_spf": True, - "default": False + "email": "example@example.com" } -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).patch(request_body=data) +response = sg.client.user.email.put(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a domain whitelabel. +## Retrieve your account email address -**This endpoint allows you to retrieve a specific domain whitelabel.** +**This endpoint allows you to retrieve the email address currently on file for your account.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about your user profile: +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### GET /whitelabel/domains/{domain_id} +### GET /user/email ```python -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).get() +response = sg.client.user.email.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a domain whitelabel. +## Update your password -**This endpoint allows you to delete a domain whitelabel.** +**This endpoint allows you to update your password.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about your user profile: -### DELETE /whitelabel/domains/{domain_id} +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### PUT /user/password ```python -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).delete() +data = { + "new_password": "new_password", + "old_password": "old_password" +} +response = sg.client.user.password.put(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Associate a domain whitelabel with a given user. +## Update a user's profile -**This endpoint allows you to associate a specific domain whitelabel with a subuser.** +**This endpoint allows you to update your current profile details.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. +For more information about your user profile: -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| domain_id | integer | ID of the domain whitelabel to associate with the subuser. | +It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH. -### POST /whitelabel/domains/{domain_id}/subuser +### PATCH /user/profile ```python data = { - "username": "jane@example.com" + "city": "Orange", + "first_name": "Example", + "last_name": "User" } -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body=data) +response = sg.client.user.profile.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Add an IP to a domain whitelabel. - -**This endpoint allows you to add an IP address to a domain whitelabel.** +## Get a user's profile -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about your user profile: -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer | ID of the domain to which you are adding an IP | +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### POST /whitelabel/domains/{id}/ips +### GET /user/profile ```python -data = { - "ip": "192.168.0.1" -} -id = "test_url_param" -response = sg.client.whitelabel.domains._(id).ips.post(request_body=data) +response = sg.client.user.profile.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Remove an IP from a domain whitelabel. - -**This endpoint allows you to remove a domain's IP address from that domain's whitelabel.** +## Cancel or pause a scheduled send -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.** -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +If the maximum number of cancellations/pauses are added, HTTP 400 will +be returned. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer | ID of the domain whitelabel to delete the IP from. | -| ip | string | IP to remove from the domain whitelabel. | +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### DELETE /whitelabel/domains/{id}/ips/{ip} +### POST /user/scheduled_sends ```python -id = "test_url_param" -ip = "test_url_param" -response = sg.client.whitelabel.domains._(id).ips._(ip).delete() +data = { + "batch_id": "YOUR_BATCH_ID", + "status": "pause" +} +response = sg.client.user.scheduled_sends.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Validate a domain whitelabel. - -**This endpoint allows you to validate a domain whitelabel. If it fails, it will return an error message describing why the whitelabel could not be validated.** - -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +## Retrieve all scheduled sends -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +**This endpoint allows you to retrieve all cancel/paused scheduled send information.** -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer |ID of the domain whitelabel to validate. | +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### POST /whitelabel/domains/{id}/validate +### GET /user/scheduled_sends ```python -id = "test_url_param" -response = sg.client.whitelabel.domains._(id).validate.post() +response = sg.client.user.scheduled_sends.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Create an IP whitelabel - -**This endpoint allows you to create an IP whitelabel.** - -When creating an IP whitelable, you should use the same subdomain that you used when you created a domain whitelabel. +## Update user scheduled send information -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### POST /whitelabel/ips +### PATCH /user/scheduled_sends/{batch_id} ```python data = { - "domain": "example.com", - "ip": "192.168.1.1", - "subdomain": "email" + "status": "pause" } -response = sg.client.whitelabel.ips.post(request_body=data) +batch_id = "test_url_param" +response = sg.client.user.scheduled_sends._(batch_id).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all IP whitelabels - -**This endpoint allows you to retrieve all of the IP whitelabels that have been created by this account.** - -You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192."). +## Retrieve scheduled send -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### GET /whitelabel/ips +### GET /user/scheduled_sends/{batch_id} ```python -params = {'ip': 'test_string', 'limit': 1, 'offset': 1} -response = sg.client.whitelabel.ips.get(query_params=params) +batch_id = "test_url_param" +response = sg.client.user.scheduled_sends._(batch_id).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve an IP whitelabel - -**This endpoint allows you to retrieve an IP whitelabel.** +## Delete a cancellation or pause of a scheduled send -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +**This endpoint allows you to delete the cancellation/pause of a scheduled send.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### GET /whitelabel/ips/{id} +### DELETE /user/scheduled_sends/{batch_id} ```python -id = "test_url_param" -response = sg.client.whitelabel.ips._(id).get() +batch_id = "test_url_param" +response = sg.client.user.scheduled_sends._(batch_id).delete() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete an IP whitelabel +## Update Enforced TLS settings -**This endpoint allows you to delete an IP whitelabel.** +**This endpoint allows you to update your current Enforced TLS settings.** -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. -### DELETE /whitelabel/ips/{id} +### PATCH /user/settings/enforced_tls ```python -id = "test_url_param" -response = sg.client.whitelabel.ips._(id).delete() +data = { + "require_tls": True, + "require_valid_cert": False +} +response = sg.client.user.settings.enforced_tls.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Validate an IP whitelabel +## Retrieve current Enforced TLS settings. -**This endpoint allows you to validate an IP whitelabel.** +**This endpoint allows you to retrieve your current Enforced TLS settings.** -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. -### POST /whitelabel/ips/{id}/validate +### GET /user/settings/enforced_tls ```python -id = "test_url_param" -response = sg.client.whitelabel.ips._(id).validate.post() +response = sg.client.user.settings.enforced_tls.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Create a Link Whitelabel +## Update your username -**This endpoint allows you to create a new link whitelabel.** +**This endpoint allows you to update the username for your account.** -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +For more information about your user profile: -### POST /whitelabel/links +* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### PUT /user/username ```python data = { - "default": True, - "domain": "example.com", - "subdomain": "mail" + "username": "test_username" } -params = {'limit': 1, 'offset': 1} -response = sg.client.whitelabel.links.post(request_body=data, query_params=params) +response = sg.client.user.username.put(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve all link whitelabels +## Retrieve your username -**This endpoint allows you to retrieve all link whitelabels.** +**This endpoint allows you to retrieve your current account username.** -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +For more information about your user profile: -### GET /whitelabel/links +* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### GET /user/username ```python -params = {'limit': 1} -response = sg.client.whitelabel.links.get(query_params=params) +response = sg.client.user.username.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a Default Link Whitelabel +## Update Event Notification Settings -**This endpoint allows you to retrieve the default link whitelabel.** +**This endpoint allows you to update your current event webhook settings.** -Default link whitelabel is the actual link whitelabel to be used when sending messages. If there are multiple link whitelabels, the default is determined by the following order: -
    -
  • Validated link whitelabels marked as "default"
  • -
  • Legacy link whitelabels (migrated from the whitelabel wizard)
  • -
  • Default Twilio SendGrid link whitelabel (i.e. 100.ct.sendgrid.net)
  • -
+If an event type is marked as `true`, then the event webhook will include information about that event. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. -### GET /whitelabel/links/default +### PATCH /user/webhooks/event/settings ```python -params = {'domain': 'test_string'} -response = sg.client.whitelabel.links.default.get(query_params=params) +data = { + "bounce": True, + "click": True, + "deferred": True, + "delivered": True, + "dropped": True, + "enabled": True, + "group_resubscribe": True, + "group_unsubscribe": True, + "open": True, + "processed": True, + "spam_report": True, + "unsubscribe": True, + "url": "url" +} +response = sg.client.user.webhooks.event.settings.patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve Associated Link Whitelabel +## Retrieve Event Webhook settings -**This endpoint allows you to retrieve the associated link whitelabel for a subuser.** +**This endpoint allows you to retrieve your current event webhook settings.** -Link whitelables can be associated with subusers from the parent account. This functionality allows -subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account -must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface. +If an event type is marked as `true`, then the event webhook will include information about that event. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. -### GET /whitelabel/links/subuser +### GET /user/webhooks/event/settings ```python -params = {'username': 'test_string'} -response = sg.client.whitelabel.links.subuser.get(query_params=params) +response = sg.client.user.webhooks.event.settings.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Disassociate a Link Whitelabel - -**This endpoint allows you to disassociate a link whitelabel from a subuser.** +## Test Event Notification Settings -Link whitelables can be associated with subusers from the parent account. This functionality allows -subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account -must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface. +**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.** -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. -### DELETE /whitelabel/links/subuser +### POST /user/webhooks/event/test ```python -params = {'username': 'test_string'} -response = sg.client.whitelabel.links.subuser.delete(query_params=params) +data = { + "url": "url" +} +response = sg.client.user.webhooks.event.test.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Update a Link Whitelabel - -**This endpoint allows you to update a specific link whitelabel. You can use this endpoint to change a link whitelabel's default status.** +## Create a parse setting -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to create a new inbound parse setting.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### PATCH /whitelabel/links/{id} +### POST /user/webhooks/parse/settings ```python data = { - "default": True + "hostname": "myhostname.com", + "send_raw": False, + "spam_check": True, + "url": "http://email.myhosthame.com" } -id = "test_url_param" -response = sg.client.whitelabel.links._(id).patch(request_body=data) +response = sg.client.user.webhooks.parse.settings.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Retrieve a Link Whitelabel - -**This endpoint allows you to retrieve a specific link whitelabel.** +## Retrieve all parse settings -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to retrieve all of your current inbound parse settings.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### GET /whitelabel/links/{id} +### GET /user/webhooks/parse/settings ```python -id = "test_url_param" -response = sg.client.whitelabel.links._(id).get() +response = sg.client.user.webhooks.parse.settings.get() print(response.status_code) print(response.body) print(response.headers) ``` -## Delete a Link Whitelabel - -**This endpoint allows you to delete a link whitelabel.** +## Update a parse setting -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to update a specific inbound parse setting.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### DELETE /whitelabel/links/{id} +### PATCH /user/webhooks/parse/settings/{hostname} ```python -id = "test_url_param" -response = sg.client.whitelabel.links._(id).delete() +data = { + "send_raw": True, + "spam_check": False, + "url": "http://newdomain.com/parse" +} +hostname = "test_url_param" +response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body=data) print(response.status_code) print(response.body) print(response.headers) ``` -## Validate a Link Whitelabel - -**This endpoint allows you to validate a link whitelabel.** +## Retrieve a specific parse setting -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to retrieve a specific inbound parse setting.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### POST /whitelabel/links/{id}/validate +### GET /user/webhooks/parse/settings/{hostname} ```python -id = "test_url_param" -response = sg.client.whitelabel.links._(id).validate.post() +hostname = "test_url_param" +response = sg.client.user.webhooks.parse.settings._(hostname).get() print(response.status_code) print(response.body) print(response.headers) ``` -## Associate a Link Whitelabel +## Delete a parse setting -**This endpoint allows you to associate a link whitelabel with a subuser account.** +**This endpoint allows you to delete a specific inbound parse setting.** -Link whitelables can be associated with subusers from the parent account. This functionality allows -subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account -must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface. +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +### DELETE /user/webhooks/parse/settings/{hostname} -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### POST /whitelabel/links/{link_id}/subuser +```python +hostname = "test_url_param" +response = sg.client.user.webhooks.parse.settings._(hostname).delete() +print(response.status_code) +print(response.body) +print(response.headers) +``` +## Retrieves Inbound Parse Webhook statistics. + +**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** + +Twilio SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments. + +There are a number of pre-made integrations for the Twilio SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). + +### GET /user/webhooks/parse/stats ```python -data = { - "username": "jane@example.com" -} -link_id = "test_url_param" -response = sg.client.whitelabel.links._(link_id).subuser.post(request_body=data) +params = {'aggregated_by': 'day', 'limit': 'test_string', 'start_date': '2016-01-01', 'end_date': '2016-04-01', 'offset': 'test_string'} +response = sg.client.user.webhooks.parse.stats.get(query_params=params) print(response.status_code) print(response.body) print(response.headers) diff --git a/examples/senderauthentication/senderauthentication.py b/examples/senderauthentication/senderauthentication.py index e799b2a1b..f842d9302 100644 --- a/examples/senderauthentication/senderauthentication.py +++ b/examples/senderauthentication/senderauthentication.py @@ -6,7 +6,7 @@ sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) ################################################## -# Create a domain whitelabel. # +# Create a domain authentication. # # POST /whitelabel/domains # data = { @@ -27,7 +27,7 @@ print(response.headers) ################################################## -# List all domain whitelabels. # +# List all domain authentications. # # GET /whitelabel/domains # params = {'username': 'test_string', 'domain': 'test_string', @@ -38,7 +38,7 @@ print(response.headers) ################################################## -# Get the default domain whitelabel. # +# Get the default domain authentication. # # GET /whitelabel/domains/default # response = sg.client.whitelabel.domains.default.get() @@ -47,7 +47,7 @@ print(response.headers) ################################################## -# List the domain whitelabel associated with the given user. # +# List the domain authentication associated with the given user. # # GET /whitelabel/domains/subuser # response = sg.client.whitelabel.domains.subuser.get() @@ -56,7 +56,7 @@ print(response.headers) ################################################## -# Disassociate a domain whitelabel from a given user. # +# Disassociate a domain authentication from a given user. # # DELETE /whitelabel/domains/subuser # response = sg.client.whitelabel.domains.subuser.delete() @@ -65,7 +65,7 @@ print(response.headers) ################################################## -# Update a domain whitelabel. # +# Update a domain authentication. # # PATCH /whitelabel/domains/{domain_id} # data = { @@ -79,7 +79,7 @@ print(response.headers) ################################################## -# Retrieve a domain whitelabel. # +# Retrieve a domain authentication. # # GET /whitelabel/domains/{domain_id} # domain_id = "test_url_param" @@ -89,7 +89,7 @@ print(response.headers) ################################################## -# Delete a domain whitelabel. # +# Delete a domain authentication. # # DELETE /whitelabel/domains/{domain_id} # domain_id = "test_url_param" @@ -99,7 +99,7 @@ print(response.headers) ################################################## -# Associate a domain whitelabel with a given user. # +# Associate a domain authentication with a given user. # # POST /whitelabel/domains/{domain_id}/subuser # data = { @@ -113,7 +113,7 @@ print(response.headers) ################################################## -# Add an IP to a domain whitelabel. # +# Add an IP to a domain authentication. # # POST /whitelabel/domains/{id}/ips # data = { @@ -126,7 +126,7 @@ print(response.headers) ################################################## -# Remove an IP from a domain whitelabel. # +# Remove an IP from a domain authentication. # # DELETE /whitelabel/domains/{id}/ips/{ip} # id_ = "test_url_param" @@ -137,7 +137,7 @@ print(response.headers) ################################################## -# Validate a domain whitelabel. # +# Validate a domain authentication. # # POST /whitelabel/domains/{id}/validate # id_ = "test_url_param" @@ -147,7 +147,7 @@ print(response.headers) ################################################## -# Create an IP whitelabel # +# Create a reverse DNS record # # POST /whitelabel/ips # data = { @@ -161,7 +161,7 @@ print(response.headers) ################################################## -# Retrieve all IP whitelabels # +# Create a reverse DNS record # # GET /whitelabel/ips # params = {'ip': 'test_string', 'limit': 1, 'offset': 1} @@ -171,7 +171,7 @@ print(response.headers) ################################################## -# Retrieve an IP whitelabel # +# Retrieve a reverse DNS record # # GET /whitelabel/ips/{id} # id_ = "test_url_param" @@ -181,7 +181,7 @@ print(response.headers) ################################################## -# Delete an IP whitelabel # +# Delete a reverse DNS record # # DELETE /whitelabel/ips/{id} # id_ = "test_url_param" @@ -191,7 +191,7 @@ print(response.headers) ################################################## -# Validate an IP whitelabel # +# Validate a reverse DNS record # # POST /whitelabel/ips/{id}/validate # id_ = "test_url_param" @@ -201,7 +201,7 @@ print(response.headers) ################################################## -# Create a Link Whitelabel # +# Create a Link Branding # # POST /whitelabel/links # data = { @@ -217,7 +217,7 @@ print(response.headers) ################################################## -# Retrieve all link whitelabels # +# Retrieve all link brandings # # GET /whitelabel/links # params = {'limit': 1} @@ -227,7 +227,7 @@ print(response.headers) ################################################## -# Retrieve a Default Link Whitelabel # +# Retrieve a Default Link Branding # # GET /whitelabel/links/default # params = {'domain': 'test_string'} @@ -237,7 +237,7 @@ print(response.headers) ################################################## -# Retrieve Associated Link Whitelabel # +# Retrieve Associated Link Branding # # GET /whitelabel/links/subuser # params = {'username': 'test_string'} @@ -247,7 +247,7 @@ print(response.headers) ################################################## -# Disassociate a Link Whitelabel # +# Disassociate a Link Branding # # DELETE /whitelabel/links/subuser # params = {'username': 'test_string'} @@ -257,7 +257,7 @@ print(response.headers) ################################################## -# Update a Link Whitelabel # +# Update a Link Branding # # PATCH /whitelabel/links/{id} # data = { @@ -270,7 +270,7 @@ print(response.headers) ################################################## -# Retrieve a Link Whitelabel # +# Retrieve a Link Branding # # GET /whitelabel/links/{id} # id_ = "test_url_param" @@ -280,7 +280,7 @@ print(response.headers) ################################################## -# Delete a Link Whitelabel # +# Delete a Link Branding # # DELETE /whitelabel/links/{id} # id_ = "test_url_param" @@ -290,7 +290,7 @@ print(response.headers) ################################################## -# Validate a Link Whitelabel # +# Validate a Link Branding # # POST /whitelabel/links/{id}/validate # id_ = "test_url_param" @@ -300,7 +300,7 @@ print(response.headers) ################################################## -# Associate a Link Whitelabel # +# Associate a Link Branding # # POST /whitelabel/links/{link_id}/subuser # data = { diff --git a/use_cases/domain_authentication.md b/use_cases/domain_authentication.md index 7ae7f2e22..d34470b39 100644 --- a/use_cases/domain_authentication.md +++ b/use_cases/domain_authentication.md @@ -1,4 +1,4 @@ -# How to Setup a Domain Whitelabel +# How to Setup a Domain Authentication You can find documentation for how to setup a domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication) and via API [here](https://github.com/sendgrid/sendgrid-python/blob/master/USAGE.md#sender-authentication). From 6882972add406ac0434008e6a2672564edfd8150 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 27 Jul 2020 17:11:48 -0500 Subject: [PATCH 083/237] chore: update README to reflect default branch rename --- README.md | 2 ++ README.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 9bc604525..9ac2fbc3b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors) [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-python/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-python) +**The default branch name for this repository has been changed to `main` as of 07/27/2020.** + **This library allows you to quickly and easily use the SendGrid Web API v3 via Python.** Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). diff --git a/README.rst b/README.rst index 5a2ef9898..3ef04e638 100644 --- a/README.rst +++ b/README.rst @@ -9,6 +9,8 @@ **NEW:** +**The default branch name for this repository has been changed to `main` as of 07/27/2020.** + - Subscribe to email `notifications`_ for releases and breaking changes. - Version 6.X release is a BREAKING CHANGE from version 5.X, please see the `release notes`_ for details. - Send SMS messages with `Twilio`_. From 1192e939a745fa1e427d13c46d842836576558f5 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Tue, 28 Jul 2020 09:56:35 -0500 Subject: [PATCH 084/237] chore: update CI config to use new default branch name --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 489a4a788..8c158b2b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ deploy: notifications: slack: - if: branch = master + if: branch = main on_pull_requests: false on_success: never on_failure: change From 182ad7a8d627a1482239c921c8157c6994e4d9dc Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 3 Aug 2020 22:32:00 +0000 Subject: [PATCH 085/237] docs: Update templated markdown docs to use new default branch name --- ISSUE_TEMPLATE.md | 6 +++++- PULL_REQUEST_TEMPLATE.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index a4b1cc240..fb2e15cef 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,5 +1,9 @@ ### Issue Summary @@ -21,6 +25,6 @@ A summary of the issue and the environment in which it occurs. If suitable, incl ``` ### Technical details: -* sendgrid-python version: +* sendgrid-python version: * python version: diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 215059a96..a86818029 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -23,7 +23,7 @@ A short description of what this PR does. - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately -- [ ] I have updated my branch with the master branch +- [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified From ba6dec464666d1bf98435d9f0bc277ed2cba6534 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 5 Aug 2020 21:24:36 +0000 Subject: [PATCH 086/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94ea6ef9c..af7fc752d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-08-05] Version 6.4.5 +-------------------------- +**Library - Docs** +- [PR #926](https://github.com/sendgrid/sendgrid-python/pull/926): remove last references of "whitelabel". Thanks to [@childish-sambino](https://github.com/childish-sambino)! + + [2020-07-22] Version 6.4.4 -------------------------- **Library - Chore** From 23c33b05ecbbdbd16246bc50bd607e5dd1534789 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 5 Aug 2020 21:28:56 +0000 Subject: [PATCH 087/237] Release 6.4.5 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index e55bc1c67..9bf999671 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.4' +__version__ = '6.4.5' From 3c3277b5f10da343e0a399a915425dd5f98e41f7 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Tue, 11 Aug 2020 10:29:40 -0700 Subject: [PATCH 088/237] chore: update GitHub branch references to use HEAD (#929) --- CHANGELOG.md | 14 +++--- CONTRIBUTING.md | 8 ++-- FIRST_TIMERS.md | 6 +-- README.md | 40 ++++++++-------- README.rst | 48 +++++++++---------- TROUBLESHOOTING.md | 6 +-- USAGE.md | 2 +- app.json | 2 +- examples/helpers/README.md | 10 ++-- examples/helpers/mail_example.py | 6 +-- examples/helpers/stats/stats_example.py | 2 +- examples/mail/mail.py | 2 +- proposals/mail-helper-refactor.md | 12 ++--- sendgrid/helpers/inbound/README.md | 14 +++--- sendgrid/helpers/inbound/templates/index.html | 2 +- sendgrid/helpers/mail/README.md | 2 +- sendgrid/helpers/stats/README.md | 4 +- use_cases/django.md | 2 +- use_cases/domain_authentication.md | 2 +- use_cases/email_stats.md | 2 +- use_cases/error_handling.md | 6 +-- 21 files changed, 96 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af7fc752d..c367217e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -152,7 +152,7 @@ All notable changes to this project will be documented in this file. ### Added - Twilio SendGrid branding -- [Twilio SMS example](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/sms.md) +- [Twilio SMS example](use_cases/sms.md) - Updated CLA process ## [6.0.0] - 2019-04-02 ## @@ -162,7 +162,7 @@ All notable changes to this project will be documented in this file. - The `Mail` helper signature has changed. - Setting up a `SendGridAPIClient` has changed. -Please see the [use cases documentation](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md) for implemenation details. +Please see the [use cases documentation](use_cases/README.md) for implemenation details. This refactor was based on [this issue](https://github.com/sendgrid/sendgrid-python/issues/347). BIG thanks to all of those who [participated](https://github.com/sendgrid/sendgrid-python/issues/323) in shaping this release. @@ -198,7 +198,7 @@ In particular, BIG THANKS to: - [PR #488](https://github.com/sendgrid/sendgrid-python/pull/488): Fix similar code issue in mail.py helper (BIG thanks to [@adiman9](https://github.com/adiman9)) - [PR #496](https://github.com/sendgrid/sendgrid-python/pull/496): Fix issues in sendgrid/helpers/mail/mail.py (BIG thanks to [@galihmelon](https://github.com/galihmelon)) - [PR #510](https://github.com/sendgrid/sendgrid-python/pull/510): Fix similar code issue in sendgrid/helpers/mail/mail.py (BIG thanks to [@nanspro](https://github.com/nanspro)) -- [PR #524](https://github.com/sendgrid/sendgrid-python/pull/524): Fix master failure on travis (relating to ASM raise-assertion). (BIG thanks to [@extemporalgenome](https://github.com/extemporalgenome)) +- [PR #524](https://github.com/sendgrid/sendgrid-python/pull/524): Fix main failure on travis (relating to ASM raise-assertion). (BIG thanks to [@extemporalgenome](https://github.com/extemporalgenome)) ### Added - [PR #666](https://github.com/sendgrid/sendgrid-python/pull/666): Created First-timers.md File (BIG thanks to [@jaykay12](https://github.com/jaykay12)) @@ -316,7 +316,7 @@ Removed the trailing white spaces. Big thanks to [Siddaram Halli](https://github ## [5.0.0] - 2017-08-11 ### BREAKING CHANGE - The breaking change actually happened in [version 4.2.1](https://github.com/sendgrid/sendgrid-python/releases/tag/v4.2.1), where I mistakenly applied a patch version bump. See issues #328 and #321 for details. -- This version (5.0.0) replaces error handling via HTTPError from urllib in favor of custom error handling via the [HTTPError class](https://github.com/sendgrid/python-http-client/blob/master/python_http_client/exceptions.py) as was the case in version 4.2.0. +- This version (5.0.0) replaces error handling via HTTPError from urllib in favor of custom error handling via the [HTTPError class](https://github.com/sendgrid/python-http-client/blob/HEAD/python_http_client/exceptions.py) as was the case in version 4.2.0. ## [4.2.1] - 2017-08-03 ## ### Fixed @@ -337,7 +337,7 @@ Removed the trailing white spaces. Big thanks to [Siddaram Halli](https://github ### BREAKING CHANGE - Pull #244 [refactor helpers using property getter/setter](https://github.com/sendgrid/sendgrid-python/pull/244/files) - Big thanks to [Denis Vlasov](https://github.com/denis90) for the pull request! -- The changes break the implementation of the [Mail Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) `Mail()` class +- The changes break the implementation of the [Mail Helper](sendgrid/helpers/mail) `Mail()` class - `set_from()` is now the property `from_email` - `set_subject()` is now the property `subject` - `set_template_id()` is now the property `template_id` @@ -426,7 +426,7 @@ Removed the trailing white spaces. Big thanks to [Siddaram Halli](https://github ## [3.2.2] - 2016-08-23 ## ### Added - Table of Contents in the README -- Added a [USE_CASES.md](https://github.com/sendgrid/sendgrid-python/blob/master/USE_CASES.md) section, with the first use case example for transactional templates +- Added a [USE_CASES.md](USE_CASES.md) section, with the first use case example for transactional templates ## [3.2.1] - 2016-08-17 ## ### Fixed @@ -448,7 +448,7 @@ Removed the trailing white spaces. Big thanks to [Siddaram Halli](https://github ## [3.1.8] - 2016-07-25 ## ### Added -- [Troubleshooting](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md) section +- [Troubleshooting](TROUBLESHOOTING.md) section ## [3.1.7] - 2016-07-25 ## ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed57a5722..92d72897e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ source .env #### Execute -See the [examples folder](https://github.com/sendgrid/sendgrid-python/tree/master/examples) to get started quickly. +See the [examples folder](examples) to get started quickly. If testing from the root directory of this repo, create a new file (e.g. test.py) and replace `import sendgrid` with `from sendgrid import *` @@ -104,7 +104,7 @@ If testing from the root directory of this repo, create a new file (e.g. test.py The PR must pass all the tests before it is reviewed. -All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/test) directory. For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](https://github.com/sendgrid/sendgrid-python/tree/master/test/test_sendgrid.py) file with unit tests as you modify the code. +All test files are in the [`test`](test) directory. For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](test/test_sendgrid.py) file with unit tests as you modify the code. The integration tests require a Twilio SendGrid mock API in order to execute. We've simplified setting this up using Docker to run the tests. You will just need [Docker Desktop](https://docs.docker.com/get-docker/) and `make`. @@ -165,7 +165,7 @@ Please run your code through: 5. Locally merge (or rebase) the upstream development branch into your topic branch: ```bash - git pull [--rebase] upstream master + git pull [--rebase] upstream main ``` 6. Push your topic branch up to your fork: @@ -175,7 +175,7 @@ Please run your code through: ``` 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) - with a clear title and description against the `master` branch. All tests must be passing before we will review the PR. + with a clear title and description against the `main` branch. All tests must be passing before we will review the PR. ## Code Reviews If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, GitHub has some great [information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/). diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index b0636fb81..4bf1b26e3 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -54,13 +54,13 @@ Kindly make sure, to check for any duplicate issues raised by fellow contributor **Step 4:** Commit the changes in logical chunks & add commit messages strictly following [this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) -**Step 5:** Run all test locally, [for more info](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#testing) +**Step 5:** Run all test locally, [for more info](CONTRIBUTING.md#testing) -**Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream master` +**Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream main` **Step 7:** Push the topic branch up to your fork using `git push origin ` -**Step 8:** Open a Pull Request with clear title and description against the master branch. +**Step 8:** Open a Pull Request with clear title and description against the main branch. ## Be Patient & Wait for Reviews diff --git a/README.md b/README.md index 9ac2fbc3b..d8049ca23 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) +![SendGrid Logo](twilio_sendgrid_logo.png) -[![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-python) -[![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/master.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) +[![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=main)](https://travis-ci.org/sendgrid/sendgrid-python) +[![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) [![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) @@ -15,7 +15,7 @@ Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). -This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-python/issues) and [pull requests](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests. +This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-python/issues) and [pull requests](CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests. Please browse the rest of this README for further detail. @@ -82,7 +82,7 @@ pip install sendgrid ## Hello Email -The following is the minimum needed code to send an email with the [/mail/send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) ([here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail_example.py#L9) is a full example): +The following is the minimum needed code to send an email with the [/mail/send Helper](sendgrid/helpers/mail) ([here](examples/helpers/mail_example.py#L9) is a full example): ### With Mail Helper Class @@ -103,11 +103,11 @@ print(response.body) print(response.headers) ``` -The `Mail` constructor creates a [personalization object](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html) for you. [Here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail_example.py#L16) is an example of how to add it. +The `Mail` constructor creates a [personalization object](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html) for you. [Here](examples/helpers/mail_example.py#L16) is an example of how to add it. ### Without Mail Helper Class -The following is the minimum needed code to send an email without the /mail/send Helper ([here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/mail/mail.py#L27) is a full example): +The following is the minimum needed code to send an email without the /mail/send Helper ([here](examples/mail/mail.py#L27) is a full example): ```python import sendgrid @@ -170,29 +170,29 @@ print(response.headers) # Processing Inbound Email -Please see [our helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound) for utilizing our Inbound Parse webhook. +Please see [our helper](sendgrid/helpers/inbound) for utilizing our Inbound Parse webhook. # Usage - [SendGrid Documentation](https://sendgrid.com/docs/API_Reference/index.html) -- [Library Usage Documentation](https://github.com/sendgrid/sendgrid-python/tree/master/USAGE.md) -- [Example Code](https://github.com/sendgrid/sendgrid-python/tree/master/examples) +- [Library Usage Documentation](USAGE.md) +- [Example Code](examples) - [How-to: Migration from v2 to v3](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) -- [v3 Web API Mail Send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) - build a request object payload for a v3 /mail/send API call. -- [Processing Inbound Email](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound) +- [v3 Web API Mail Send Helper](sendgrid/helpers/mail) - build a request object payload for a v3 /mail/send API call. +- [Processing Inbound Email](sendgrid/helpers/inbound) # Use Cases -[Examples of common API use cases](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md), such as how to send an email with a transactional template. +[Examples of common API use cases](use_cases/README.md), such as how to send an email with a transactional template. # Announcements Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated! -All updates to this library are documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. +All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. # Roadmap @@ -202,19 +202,19 @@ If you are interested in the future direction of this project, please take a loo # How to Contribute -We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md) guide for details. +We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details. Quick links: -- [Feature Request](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#feature-request) -- [Bug Reports](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit-a-bug-report) -- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase) -- [Review Pull Requests](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews) +- [Feature Request](CONTRIBUTING.md#feature-request) +- [Bug Reports](CONTRIBUTING.md#submit-a-bug-report) +- [Improvements to the Codebase](CONTRIBUTING.md#improvements-to-the-codebase) +- [Review Pull Requests](CONTRIBUTING.md#code-reviews) # Troubleshooting -Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md) for common library issues. +Please see our [troubleshooting guide](TROUBLESHOOTING.md) for common library issues. # About diff --git a/README.rst b/README.rst index 3ef04e638..88d0fb280 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -.. image:: https://github.com/sendgrid/sendgrid-python/raw/master/twilio_sendgrid_logo.png +.. image:: https://github.com/sendgrid/sendgrid-python/raw/HEAD/twilio_sendgrid_logo.png :target: https://www.sendgrid.com @@ -103,7 +103,7 @@ Hello Email ----------- The following is the minimum needed code to send an email with the `/mail/send Helper`_ -(`here `__ is a full example): +(`here `__ is a full example): With Mail Helper Class ~~~~~~~~~~~~~~~~~~~~~~ @@ -129,13 +129,13 @@ With Mail Helper Class print(str(e)) The ``Mail`` constructor creates a `personalization object`_ for you. -`Here `__ is an example of how to add it. +`Here `__ is an example of how to add it. Without Mail Helper Class ~~~~~~~~~~~~~~~~~~~~~~~~~ The following is the minimum needed code to send an email without the /mail/send Helper -(`here `__ is a full example): +(`here `__ is a full example): .. code:: python @@ -262,47 +262,47 @@ License `The MIT License (MIT)`_ .. _notifications: https://dx.sendgrid.com/newsletter/python -.. _Twilio: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/sms.md +.. _Twilio: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/sms.md .. _release notes: https://github.com/sendgrid/sendgrid-python/releases/tag/v6.0.0 .. _Web API v3: https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html .. _v3 /mail/send: https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint .. _issues: https://github.com/sendgrid/sendgrid-python/issues -.. _pull requests: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md +.. _pull requests: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md .. _free level: https://sendgrid.com/free?source=sendgrid-python .. _Twilio account: https://www.twilio.com/try-twilio?source=sendgrid-python .. _SENDGRID_API_KEY: https://app.sendgrid.com/settings/api_keys .. _Python-HTTP-Client: https://github.com/sendgrid/python-http-client .. _ECDSA-Python: https://github.com/starkbank/ecdsa-python -.. _/mail/send Helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail +.. _/mail/send Helper: https://github.com/sendgrid/sendgrid-python/tree/HEAD/sendgrid/helpers/mail .. _personalization object: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html .. _Fluent Interface: https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/ -.. _our helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound +.. _our helper: https://github.com/sendgrid/sendgrid-python/tree/HEAD/sendgrid/helpers/inbound .. _Twilio SendGrid Documentation: https://sendgrid.com/docs/API_Reference/index.html -.. _Library Usage Documentation: https://github.com/sendgrid/sendgrid-python/tree/master/USAGE.md -.. _Example Code: https://github.com/sendgrid/sendgrid-python/tree/master/examples +.. _Library Usage Documentation: https://github.com/sendgrid/sendgrid-python/tree/HEAD/USAGE.md +.. _Example Code: https://github.com/sendgrid/sendgrid-python/tree/HEAD/examples .. _`How-to: Migration from v2 to v3`: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html -.. _v3 Web API Mail Send Helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail -.. _Processing Inbound Email: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound -.. _Examples of common API use cases: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md +.. _v3 Web API Mail Send Helper: https://github.com/sendgrid/sendgrid-python/tree/HEAD/sendgrid/helpers/mail +.. _Processing Inbound Email: https://github.com/sendgrid/sendgrid-python/tree/HEAD/sendgrid/helpers/inbound +.. _Examples of common API use cases: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/README.md .. _breaking changes: https://github.com/sendgrid/sendgrid-python/issues/217 -.. _CHANGELOG: https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md +.. _CHANGELOG: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CHANGELOG.md .. _releases: https://github.com/sendgrid/sendgrid-python/releases .. _release notifications: https://dx.sendgrid.com/newsletter/python -.. _CONTRIBUTING: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md -.. _Feature Request: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#feature-request -.. _Bug Reports: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit-a-bug-report -.. _Improvements to the Codebase: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase -.. _Review Pull Requests: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews -.. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md -.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/master/LICENSE.md - -.. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master +.. _CONTRIBUTING: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md +.. _Feature Request: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#feature-request +.. _Bug Reports: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#submit-a-bug-report +.. _Improvements to the Codebase: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#improvements-to-the-codebase +.. _Review Pull Requests: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#code-reviews +.. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md +.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/HEAD/LICENSE.md + +.. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=main :target: https://travis-ci.org/sendgrid/sendgrid-python .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/sendgrid.svg :target: https://pypi.org/project/sendgrid/ .. |PyPI Version| image:: https://img.shields.io/pypi/v/sendgrid.svg :target: https://pypi.org/project/sendgrid/ -.. |codecov| image:: https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/master.svg?style=flat-square&label=Codecov+Coverage +.. |codecov| image:: https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage :target: https://codecov.io/gh/sendgrid/sendgrid-python .. |Docker Badge| image:: https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg :target: https://hub.docker.com/r/sendgrid/sendgrid-python/ diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index f3a64ec3c..589aa2e6a 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -34,7 +34,7 @@ In the first case, SENDGRID_API_KEY is in reference to the name of the environme ## Error Messages -HTTP exceptions are defined in the [`python_http_client` package](https://github.com/sendgrid/python-http-client/blob/master/python_http_client/exceptions.py). +HTTP exceptions are defined in the [`python_http_client` package](https://github.com/sendgrid/python-http-client/blob/HEAD/python_http_client/exceptions.py). To read the error message returned by SendGrid's API in Python 2.X: @@ -100,7 +100,7 @@ If you are using a [requirements file](https://pip.readthedocs.io/en/1.1/require ## Versioning Convention -We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases) section. +We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases) section. ## Viewing the Request Body @@ -116,4 +116,4 @@ You can do this right before you call `response = sg.client.mail.send.post(reque # Error Handling -Please review [our use_cases](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md) for examples of error handling. +Please review [our use_cases](use_cases/README.md) for examples of error handling. diff --git a/USAGE.md b/USAGE.md index b6d044676..978b675ab 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2105,7 +2105,7 @@ For more detailed information about how to use the v3 Mail Send endpoint, please ### POST /mail/send -This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/README.md). +This endpoint has a helper, check it out [here](sendgrid/helpers/mail/README.md). ```python data = { diff --git a/app.json b/app.json index b63428351..e25064d12 100644 --- a/app.json +++ b/app.json @@ -6,6 +6,6 @@ "inbound parse" ], "website": "http://www.sendgrid.com", - "repository": "https://github.com/sendgrid/sendgrid-python/tree/master", + "repository": "https://github.com/sendgrid/sendgrid-python", "logo": "https://sendgrid.com/brand/sg-twilio/SG_Twilio_Lockup_RGBx1.png" } \ No newline at end of file diff --git a/examples/helpers/README.md b/examples/helpers/README.md index 2eebbe421..df1746b52 100644 --- a/examples/helpers/README.md +++ b/examples/helpers/README.md @@ -24,7 +24,7 @@ The `Content` class takes mainly two parameters: MIME type and the actual conten mail = Mail(from_email, to_email, subject, content) ``` After adding the above we create a mail object using `Mail` class, it takes the following parameters: email address to send from, subject line of emails, email address to send to, content of the message. -For more information on parameters and usage, see [here](https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/mail.py) +For more information on parameters and usage, see [here](../mail/mail.py) ### Creating Personalizations @@ -44,13 +44,13 @@ To create attachments, we use the `Attachment` class and make sure the content i attachment.content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl" "Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12") ``` -Another example: [Link](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/attachment.md) +Another example: [Link](../../use_cases/attachment.md) ### Managing Settings -To configure settings in mail, you can use the `MailSettings` class. The class takes some [parameters](https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/mail_settings.py#L1)(such as bcc_settings, bypass_list_management, footer_settings, sandbox_mode) +To configure settings in mail, you can use the `MailSettings` class. The class takes some [parameters](../mailsettings/mailsettings.py#L1)(such as bcc_settings, bypass_list_management, footer_settings, sandbox_mode) -To add tracking settings, you can add `TrackingSettings` class. See example [here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail_example.py#L118) and parameters and usage [here](https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/tracking_settings.py). +To add tracking settings, you can add `TrackingSettings` class. See example [here](mail_example.py#L118) and parameters and usage [here](../trackingsettings/trackingsettings.py). ### Sending email @@ -60,7 +60,7 @@ After you have configured every component and added your own functions, you can data = build_kitchen_sink() response = sg.send(data) ``` -Make sure you have [environment variable](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key) set up! +Make sure you have [environment variable](../../TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key) set up! Full example [here](https://github.com/sendgrid/sendgrid-python/blob/0b683169b08d3a7c204107cd333be33053297e74/examples/helpers/mail_example.py#L203). ### Using Dynamic Templates diff --git a/examples/helpers/mail_example.py b/examples/helpers/mail_example.py index c57520a9e..de1648df9 100644 --- a/examples/helpers/mail_example.py +++ b/examples/helpers/mail_example.py @@ -81,7 +81,7 @@ def get_mock_personalization_dict(): def build_attachment1(): """Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content. - Another example: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/attachment.md""" + Another example: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/attachment.md""" attachment = Attachment() attachment.content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl" "Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12") @@ -311,7 +311,7 @@ def build_kitchen_sink(): def send_hello_email(): # Assumes you set your environment variable: - # https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key + # https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key message = build_hello_email() sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) response = sendgrid_client.send(message=message) @@ -322,7 +322,7 @@ def send_hello_email(): def send_kitchen_sink(): # Assumes you set your environment variable: - # https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key + # https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key message = build_kitchen_sink() sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) response = sendgrid_client.send(message=message) diff --git a/examples/helpers/stats/stats_example.py b/examples/helpers/stats/stats_example.py index ebe24f69f..f22baa5c4 100644 --- a/examples/helpers/stats/stats_example.py +++ b/examples/helpers/stats/stats_example.py @@ -6,7 +6,7 @@ # NOTE: you will need to move this file to the root directory of this project to execute properly. # Assumes you set your environment variable: -# See: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key +# See: https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) diff --git a/examples/mail/mail.py b/examples/mail/mail.py index d59901d1d..d2ccc80f0 100644 --- a/examples/mail/mail.py +++ b/examples/mail/mail.py @@ -27,7 +27,7 @@ # v3 Mail Send # # POST /mail/send # # This endpoint has a helper, check it out -# [here](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md). +# [here](https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/README.md). data = { "asm": { diff --git a/proposals/mail-helper-refactor.md b/proposals/mail-helper-refactor.md index 91ecfe878..70798c262 100644 --- a/proposals/mail-helper-refactor.md +++ b/proposals/mail-helper-refactor.md @@ -2,7 +2,7 @@ # Send a Single Email to a Single Recipient -The following code assumes you are storing the API key in an [environment variable (recommended)](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. +The following code assumes you are storing the API key in an [environment variable (recommended)](../TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. This is the minimum code needed to send an email. @@ -29,7 +29,7 @@ except SendGridException as e: # Send a Single Email to Multiple Recipients -The following code assumes you are storing the API key in an [environment variable (recommended)](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. +The following code assumes you are storing the API key in an [environment variable (recommended)](../TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. ```python import os @@ -57,7 +57,7 @@ except Exception as e: # Send Multiple Emails to Multiple Recipients -The following code assumes you are storing the API key in an [environment variable (recommended)](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. +The following code assumes you are storing the API key in an [environment variable (recommended)](../TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. ```python import os @@ -100,7 +100,7 @@ except Exception as e: # Kitchen Sink - an example with all settings used -The following code assumes you are storing the API key in an [environment variable (recommended)](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. +The following code assumes you are storing the API key in an [environment variable (recommended)](../TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. ```python import os @@ -246,7 +246,7 @@ except Exception as e: # Attachments -The following code assumes you are storing the API key in an [environment variable (recommended)](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. +The following code assumes you are storing the API key in an [environment variable (recommended)](../TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. ```python import os @@ -275,7 +275,7 @@ except Exception as e: # Transactional Templates -The following code assumes you are storing the API key in an [environment variable (recommended)](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. +The following code assumes you are storing the API key in an [environment variable (recommended)](../TROUBLESHOOTING.md#environment). If you don't have your key stored in an environment variable, you can assign it directly to `apikey` for testing purposes. For this example, we assume you have created a [transactional template](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). Following is the template content we used for testing. diff --git a/sendgrid/helpers/inbound/README.md b/sendgrid/helpers/inbound/README.md index 93d0817b6..79e5b4544 100644 --- a/sendgrid/helpers/inbound/README.md +++ b/sendgrid/helpers/inbound/README.md @@ -36,7 +36,7 @@ pip install -r requirements.txt python sendgrid/helpers/inbound/send.py ./sendgrid/helpers/inbound/sample_data/default_data.txt ``` -More sample data can be found [here](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound/sample_data). +More sample data can be found [here](sample_data). View the results in the first terminal. @@ -71,7 +71,7 @@ Next, send an email to [anything]@inbound.yourdomain.com, then look at the termi Get a [Heroku](https://www.heroku.com) account. -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/sendgrid/sendgrid-python/tree/master) +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/sendgrid/sendgrid-python/tree/main) [Setup your MX records.](https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html#-Setup) Depending on your domain name host, you may need to wait up to 48 hours for the settings to propagate. @@ -100,7 +100,7 @@ heroku git:remote -a [name-of-your-app] ---make changes--- git add . git commit -m "update configuration" -git push heroku master +git push heroku main ``` @@ -127,12 +127,12 @@ This module is used to send sample test data. It is useful for testing and devel Tests are located in the root of this project in the /test folder: -- [test_config.py](https://github.com/sendgrid/sendgrid-python/blob/master/test/test_config.py) -- [test_parse.py](https://github.com/sendgrid/sendgrid-python/blob/master/test/test_parse.py) +- [test_config.py](../../../test/test_config.py) +- [test_parse.py](../../../test/test_parse.py) -Learn about testing this code [here](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#testing). +Learn about testing this code [here](../../../CONTRIBUTING.md#testing). # Contributing -If you would like to contribute to this project, please see our [contributing guide](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md). Thanks! +If you would like to contribute to this project, please see our [contributing guide](../../../CONTRIBUTING.md). Thanks! diff --git a/sendgrid/helpers/inbound/templates/index.html b/sendgrid/helpers/inbound/templates/index.html index 0de3f44f3..7cbede381 100644 --- a/sendgrid/helpers/inbound/templates/index.html +++ b/sendgrid/helpers/inbound/templates/index.html @@ -5,6 +5,6 @@

You have successfully launched the server!

- Check out the documentation on how to use this software to utilize the SendGrid Inbound Parse webhook. + Check out the documentation on how to use this software to utilize the SendGrid Inbound Parse webhook. \ No newline at end of file diff --git a/sendgrid/helpers/mail/README.md b/sendgrid/helpers/mail/README.md index 29e21dea5..bbf0a2ece 100644 --- a/sendgrid/helpers/mail/README.md +++ b/sendgrid/helpers/mail/README.md @@ -6,5 +6,5 @@ Please complete the [installation steps](https://github.com/sendgrid/sendgrid-py ## Usage -- For the most common use cases, please see [these examples](https://github.com/sendgrid/sendgrid-python/tree/master/use_cases) +- For the most common use cases, please see [these examples](../../../use_cases) - The complete v3 API Documentation can be found [here](https://sendgrid.com/docs/API_Reference/api_v3.html) diff --git a/sendgrid/helpers/stats/README.md b/sendgrid/helpers/stats/README.md index 4ef738410..f1591ecce 100644 --- a/sendgrid/helpers/stats/README.md +++ b/sendgrid/helpers/stats/README.md @@ -2,9 +2,9 @@ # Quick Start -Run the [example](https://github.com/sendgrid/sendgrid-python/tree/master/examples/helpers/stats) (make sure you have set your environment variable to include your SENDGRID_API_KEY). +Run the [example](../../../examples/helpers/stats) (make sure you have set your environment variable to include your SENDGRID_API_KEY). ## Usage -- See the [examples](https://github.com/sendgrid/sendgrid-python/tree/master/examples/helpers/stats) for complete working examples. +- See the [examples](../../../examples/helpers/stats) for complete working examples. - [Documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/Stats/index.html) diff --git a/use_cases/django.md b/use_cases/django.md index c71175faa..809b491a6 100644 --- a/use_cases/django.md +++ b/use_cases/django.md @@ -196,7 +196,7 @@ Commit the code to the repository and deploy it to Heroku using Git. ``` $ git add . $ git commit -am "Create simple Hello Email Django app using Twilio SendGrid" -$ git push heroku master +$ git push heroku main ``` After that, let's verify if our app is working or not by accessing the root domain of your Heroku app. You should see the page says "Email Sent!" and on the Activity Feed page in the Twilio SendGrid dashboard, you should see a new feed with the email you set in the code. diff --git a/use_cases/domain_authentication.md b/use_cases/domain_authentication.md index d34470b39..4740f92f9 100644 --- a/use_cases/domain_authentication.md +++ b/use_cases/domain_authentication.md @@ -1,5 +1,5 @@ # How to Setup a Domain Authentication -You can find documentation for how to setup a domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication) and via API [here](https://github.com/sendgrid/sendgrid-python/blob/master/USAGE.md#sender-authentication). +You can find documentation for how to setup a domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication) and via API [here](../USAGE.md#sender-authentication). Find more information about all of Twilio SendGrid's domain authentication related documentation [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication). diff --git a/use_cases/email_stats.md b/use_cases/email_stats.md index 7799710d2..c40ccb882 100644 --- a/use_cases/email_stats.md +++ b/use_cases/email_stats.md @@ -1,5 +1,5 @@ # How to View Email Statistics -You can find documentation for how to view your email statistics via the UI [here](https://app.sendgrid.com/statistics) and via API [here](https://github.com/sendgrid/sendgrid-python/blob/master/USAGE.md#stats). +You can find documentation for how to view your email statistics via the UI [here](https://app.sendgrid.com/statistics) and via API [here](../USAGE.md#stats). Alternatively, we can post events to a URL of your choice via our [Event Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/event.html) about events that occur as Twilio SendGrid processes your email. \ No newline at end of file diff --git a/use_cases/error_handling.md b/use_cases/error_handling.md index eaeabad18..187703b60 100644 --- a/use_cases/error_handling.md +++ b/use_cases/error_handling.md @@ -1,9 +1,9 @@ # Error Handling -[Custom exceptions](https://github.com/sendgrid/python-http-client/blob/master/python_http_client/exceptions.py) for `python_http_client` are now supported. +[Custom exceptions](https://github.com/sendgrid/python-http-client/blob/HEAD/python_http_client/exceptions.py) for `python_http_client` are now supported. -Please see [here](https://github.com/sendgrid/python-http-client/blob/master/python_http_client/exceptions.py) for a list of supported exceptions. +Please see [here](https://github.com/sendgrid/python-http-client/blob/HEAD/python_http_client/exceptions.py) for a list of supported exceptions. -There are also email specific exceptions located [here](https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/exceptions.py) +There are also email specific exceptions located [here](../sendgrid/helpers/mail/exceptions.py) ```python import os From b94fa7ad53fa821f80ae07a496e87c2d578e79bf Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Tue, 18 Aug 2020 10:11:13 -0500 Subject: [PATCH 089/237] docs: clean up and reconcile first timers documentation --- FIRST_TIMERS.md | 148 ++++++++++++++++++---------------- static/img/github-fork.png | Bin 0 -> 15189 bytes static/img/github-sign-up.png | Bin 0 -> 116981 bytes 3 files changed, 79 insertions(+), 69 deletions(-) create mode 100644 static/img/github-fork.png create mode 100644 static/img/github-sign-up.png diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index 4bf1b26e3..f6406f783 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -1,69 +1,79 @@ -## Welcome to the Twilio SendGrid Open Source Community -If you are new to Open Source, you are at the right place to start with. Contributions are always encouraged & appreciated. Just follow the organisation's Contribution Policies & you are good to go. - -## How to get Started? -- [Explore Twilio SendGrid](#explore) -- [Raise Issues(If Found Any)](#issues) -- [Setting up the Development Environment](#setup) -- [Proposing Change through a Pull Request](#pr) -- [Be Patient & Wait for reviews](#reviews) - - -### Explore Twilio SendGrid -Step 1: Get yourself Access to Twilio SendGrid API Service absolutely free from [here](https://sendgrid.com/free/?source=sendgrid-python) \ -Step 2: Get familiar with Twilio SendGrid Service -- Prerequisites are Python version 2.6, 2.7, 3.4, 3.5 or 3.6 -- Set up your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace [using](https://github.com/sendgrid/sendgrid-python#setup-environment-variables) -- Install Twilio SendGrid to your workspace using `pip install sendgrid` -- Copy & Run few sample programs from [here](https://github.com/sendgrid/sendgrid-python#hello-email) - - -### Raise Issues -Twilio SendGrid uses GitHub as the content management service so, all the issues related to the project be it some feature request or a bug report, all are reported at the [GitHub Issue Tracker](https://github.com/sendgrid/sendgrid-python/issues)\ -Kindly make sure, to check for any duplicate issues raised by fellow contributors before opening a new issue. Be humble & polite while commenting on issues -- Feature Request\ - In case you feel like something is missing or lacking in the API Service, feel free to share your views & opinions with the community -- Bug Report\ - If you encounter any sort of bug or abnormal behavior, feel free to inform the community after performing the following checks: - - Update to the latest version & check if the bug persists - - Check the Issue Tracker for any similar bug report - - Finally, fill up the Bug Report Template & Open the Issue highlighting your encountered bug & detailed steps to regenerate the bug. - - -### Setting up the Development Environment -- **Setting up Locally** - - Step 1: Install the Prerequistes: Any Version of Python (2.6 through 3.6) and both [python_http_client](https://github.com/sendgrid/python-http-client) and [ecdsa_python](https://github.com/starkbank/ecdsa-python) - - Step 2: Get a local copy of repository using `git clone https://github.com/sendgrid/sendgrid-python.git` - - Step 3: Set your [Twilio SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace using\ - `echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env`\ - `echo "sendgrid.env" >> .gitignore`\ - `source ./sendgrid.env` - - Step 4: The entire codebase consist of 3 major divisions -- **/examples** contains *Working examples that demonstrate usage* -- **/tests** contains *the unit and profiling tests* -- **/sendgrid** contains *the Web API v3 client ie sendgrid.py and other files*. - - -## Proposing Change through a Pull Request -**Step 1:** Fork the project & Clone your fork using `git clone https://github.com//sendgrid-python.git` - -**Step 2:** Reconfigure the remotes using `cd sendgrid-python` and `git remote add upstream https://github.com/sendgrid/sendgrid-python.git` - -**Step 3:** Create a new branch for your modifications using `git checkout -b ` - -**Step 4:** Commit the changes in logical chunks & add commit messages strictly following [this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - -**Step 5:** Run all test locally, [for more info](CONTRIBUTING.md#testing) - -**Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream main` - -**Step 7:** Push the topic branch up to your fork using `git push origin ` - -**Step 8:** Open a Pull Request with clear title and description against the main branch. - - -## Be Patient & Wait for Reviews -Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required amendments & changes to the PR as asked. - -## [Explore New Issues to work upon](https://github.com/sendgrid/sendgrid-python/labels/difficulty%3A%20easy) +# How To Contribute to Twilio SendGrid Repositories via GitHub +Contributing to the Twilio SendGrid repositories is easy! All you need to do is find an open issue (see the bottom of this page for a list of repositories containing open issues), fix it and submit a pull request. Once you have submitted your pull request, the team can easily review it before it is merged into the repository. + +To make a pull request, follow these steps: + +1. Log into GitHub. If you do not already have a GitHub account, you will have to create one in order to submit a change. Click the Sign up link in the upper right-hand corner to create an account. Enter your username, password, and email address. If you are an employee of Twilio SendGrid, please use your full name with your GitHub account and enter Twilio SendGrid as your company so we can easily identify you. + + + +2. __[Fork](https://help.github.com/fork-a-repo/)__ the [sendgrid-python](https://github.com/sendgrid/sendgrid-python) repository: + + + +3. __Clone__ your fork via the following commands: + +```bash +# Clone your fork of the repo into the current directory +git clone https://github.com/your_username/sendgrid-python +# Navigate to the newly cloned directory +cd sendgrid-python +# Assign the original repo to a remote called "upstream" +git remote add upstream https://github.com/sendgrid/sendgrid-python +``` + +> Don't forget to replace *your_username* in the URL by your real GitHub username. + +4. __Create a new topic branch__ (off the main project development branch) to contain your feature, change, or fix: + +```bash +git checkout -b +``` + +5. __Commit your changes__ in logical chunks. + +Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. Probably you will also have to create tests (if needed) or create or update the example code that demonstrates the functionality of this change to the code. + +6. __Locally merge (or rebase)__ the upstream development branch into your topic branch: + +```bash +git pull [--rebase] upstream main +``` + +7. __Push__ your topic branch up to your fork: + +```bash +git push origin +``` + +8. __[Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#changing-the-branch-range-and-destination-repository/)__ with a clear title and description against the `main` branch. All tests must be passing before we will review the PR. + +## Important notice + +Before creating a pull request, make sure that you respect the repository's constraints regarding contributions. You can find them in the [CONTRIBUTING.md](CONTRIBUTING.md) file. + +## Repositories with Open, Easy, Help Wanted, Issue Filters + +* [Python SDK](https://github.com/sendgrid/sendgrid-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [PHP SDK](https://github.com/sendgrid/sendgrid-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [C# SDK](https://github.com/sendgrid/sendgrid-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Ruby SDK](https://github.com/sendgrid/sendgrid-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Python STMPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [PHP STMPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [C# STMPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Ruby STMPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Node.js STMPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Java STMPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Go STMPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Java HTTP Client](https://github.com/sendgrid/java-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Ruby HTTP Client](https://github.com/sendgrid/ruby-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Go HTTP Client](https://github.com/sendgrid/rest/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Open API Definition](https://github.com/sendgrid/sendgrid-oai/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [DX Automator](https://github.com/sendgrid/dx-automator/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Documentation](https://github.com/sendgrid/docs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) diff --git a/static/img/github-fork.png b/static/img/github-fork.png new file mode 100644 index 0000000000000000000000000000000000000000..6503be362193808dc19bce69d8ccdf518d9ef93f GIT binary patch literal 15189 zcmbumWmFwYw=UdRa0>*26Wj^z?!nzHSa4_ImLS31o#5_nA-KC+@P)g>xAwd5J?9(a z{<-6x^m+tEH&iX1pylJ&jUTt0!d(; zMP<|w5D-?j6gMHa7%mc8E~@tCE+AtkGeGs5tBZ@7lS$wtA^?yAGU6g??#m}@AU&+R zC*YhqMiwCkR%Q_i3Jw;obhH)MuEzE01H-NEMNxBUPVUE_9H19aGE(2^6epssF*1?=E`ts&|&`rN^ltNGdkgNf_bN4-8R+T#fv|Pyg%M zcrE~v1Ihkf3iF@BPd}=`{}*LGD#ah6|EcWLH6|u(PWzY-)3rD{s`K*SN?Bh>hS;3E{afw_OJYZH)K}u+{y`(Sxgi|k!q-P z{&-{E(*7(P1tX$v`xI2WWFsITpsqeQ!6EW-Zh|yx48;;&Gmu5RxsB7HSdMCBWTHq(4FwfdXav>=Nx7o4S0&R+%k@ujqbz^=sxm>? zc@c`2)<1o5B20q~J^)Y89U%EL-_9|8V^7P<%2J|v*2DUt{DSg#={d%Ybg>r+B5MWz zVfTX-yQdeYl_1O3jAF9ae`SqyetY? z(>^I7fs-}Rjk@CJwxp3MCZs#cd8%C_l>5?PIxOaL8F)dRErD(vUxW9iib~j+e8C0&O6druu_Tk$X9C)Z${Zg|ae$K|o+_ zZT(%@r>nTr_eC;%?6v9IFjekdPL5JeUY;nA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{?MHd&NHcTJSSJ_mB%v%FH+~CulSsH$wnLgQv@S*xms&WKFt-0<%O-KDYeGEg~zM(F~+QS z#Blr=LbnXg+#OTvLr|vniW&g#A}_2E903J9VCSl($6SRR(ANYItcIi*)iCkGGq{Z6 zXFf95u?uCmMEx;;lTEnWH|%ezTwhnzbU{p|7vIKhyM>caR@dlU5F7FII?NA6z5m1t zWJ#R@#3<~a3|u^W;W->zaawk8Y_sTOP8vLFP?%_`3xM6S88BdXNWbk}vebq@yhod3 z?1)^Cp(yb9c_R11FJBzX0_4o7VB3P@a!wbU z-6wd?hIPRSywCEWz{6EvsMrvj-$Nm8DR?=*wW|>LxL0~Zija8-oT zjU*`oBbvhRYI^Zj|FzEKa0`Uo>^ziYYFu22ITe2p&BPo$WSlKKK25a*l9Jl0_mqWh zr*XXSl}wqe;V)idA)Yf)&He6bQc*Kl=F(5BE7V`;YPY7Ps9m@eQ$(f4Gh2c{!-dS< zA8F(ppF$b13+l^k>(dB$5vtus^Y`*idHni1vQK(YiLrw>y(M;4%`ACAbByZR$gI@` z|C7tfXX}ekGiHZ2@B4GB@mjwB%>TKjWj2a`xU*1X-f)&RnR+qGs!$bAGiA=lZhZaxk@Jf2xin*Rz6ns7rKu zXiMYWH_C+cX6?yVof*E>!*YgsyOIz7$gC(TCq8r~4E=4bGCnB} zy_0a<8ORr7sC}?_nq Oll& Date: Wed, 19 Aug 2020 18:54:23 +0000 Subject: [PATCH 090/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c367217e7..d01488a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-08-19] Version 6.4.6 +-------------------------- +**Library - Chore** +- [PR #929](https://github.com/sendgrid/sendgrid-python/pull/929): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)! + + [2020-08-05] Version 6.4.5 -------------------------- **Library - Docs** From bf2aee6b23ab486b86bae4a8121e629b4ef60b33 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 19 Aug 2020 19:45:02 +0000 Subject: [PATCH 091/237] Release 6.4.6 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 9bf999671..a8b77c27e 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.5' +__version__ = '6.4.6' From f9d0513aacfa8293920d472aa744524417b5c5f2 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 24 Aug 2020 09:57:48 -0500 Subject: [PATCH 092/237] docs: remove roadmap/milestone sections for CONTRIBUTING and README --- CONTRIBUTING.md | 3 --- README.md | 6 ------ README.rst | 8 -------- 3 files changed, 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92d72897e..c2769176d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,9 +17,6 @@ All third party contributors acknowledge that any contributions they provide wil - [Creating a Pull Request](#creating-a-pull-request) - [Code Reviews](#code-reviews) - -We use [Milestones](https://github.com/sendgrid/sendgrid-python/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community reviews, comments, suggestions, and additional PRs are welcomed and encouraged. - There are a few ways to contribute, which we'll enumerate below: ## Feature Request diff --git a/README.md b/README.md index d8049ca23..f6f8c76bc 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ We appreciate your continued support, thank you! * [Usage](#usage) * [Use Cases](#use-cases) * [Announcements](#announcements) -* [Roadmap](#roadmap) * [How to Contribute](#contribute) * [Troubleshooting](#troubleshooting) * [About](#about) @@ -194,11 +193,6 @@ Please see our announcement regarding [breaking changes](https://github.com/send All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. - -# Roadmap - -If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/sendgrid/sendgrid-python/issues) and [pull requests](https://github.com/sendgrid/sendgrid-python/pulls). We would love to hear your feedback. - # How to Contribute diff --git a/README.rst b/README.rst index 88d0fb280..cd2c6bbac 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,6 @@ Table of Contents - `General Usage <#usage>`__ - `Processing Inbound Email <#processing-inbound-email>`__ - `Announcements <#announcements>`__ -- `Roadmap <#roadmap>`__ - `How to Contribute <#how-to-contribute>`__ - `Troubleshooting <#troubleshooting>`__ - `About <#about>`__ @@ -226,13 +225,6 @@ Announcements All updates to this library are documented in our `CHANGELOG`_ and `releases`_. You may also subscribe to email `release notifications`_ for releases and breaking changes. -Roadmap -======= - -If you are interested in the future direction of this project, -please take a look at our open `issues`_ and `pull requests `__. -We would love to hear your feedback. - How to Contribute ================= From fd8375601c7f6a76738f18a7ae194ccb2f720ae3 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Fri, 28 Aug 2020 15:29:02 -0700 Subject: [PATCH 093/237] chore: move encrypted tokens to environment variables --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c158b2b3..51b69d9d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,5 +38,4 @@ notifications: on_pull_requests: false on_success: never on_failure: change - rooms: - - secure: Yp7gJ6NPRPNgO77vwS0HynSdnU5LYlLlUNBEzcx+zy230UxuLLWcYZtIqsIqt4oZm45OwgJLBwoCMgmU2Jcj79rGyqWKYtUcLMLKgHVzSgxjm2outt2fxjXIJHIU60S3RCGofBJRkPwEMb7ibgwHYBEsH3wIeLrVVbWvimxka6A= + rooms: $SLACK_TOKEN From 9392eabd2d0f9d0eae4321448c4f91dc578cc08b Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Tue, 1 Sep 2020 13:23:18 -0700 Subject: [PATCH 094/237] Revert "chore: move encrypted tokens to environment variables" This reverts commit fd837560 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 51b69d9d2..8c158b2b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,4 +38,5 @@ notifications: on_pull_requests: false on_success: never on_failure: change - rooms: $SLACK_TOKEN + rooms: + - secure: Yp7gJ6NPRPNgO77vwS0HynSdnU5LYlLlUNBEzcx+zy230UxuLLWcYZtIqsIqt4oZm45OwgJLBwoCMgmU2Jcj79rGyqWKYtUcLMLKgHVzSgxjm2outt2fxjXIJHIU60S3RCGofBJRkPwEMb7ibgwHYBEsH3wIeLrVVbWvimxka6A= From 6606e8de915e873ace7e01e195e9f464b20609f1 Mon Sep 17 00:00:00 2001 From: Arbitrage0 <24595000+Arbitrage0@users.noreply.github.com> Date: Thu, 10 Sep 2020 20:54:16 +0100 Subject: [PATCH 095/237] docs: correct attachment example (#936) --- examples/helpers/mail_example.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/helpers/mail_example.py b/examples/helpers/mail_example.py index de1648df9..700970110 100644 --- a/examples/helpers/mail_example.py +++ b/examples/helpers/mail_example.py @@ -83,10 +83,10 @@ def build_attachment1(): """Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content. Another example: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/attachment.md""" attachment = Attachment() - attachment.content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl" + attachment.file_content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl" "Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12") - attachment.type = "application/pdf" - attachment.filename = "balance_001.pdf" + attachment.file_type = "application/pdf" + attachment.file_name = "balance_001.pdf" attachment.disposition = "attachment" attachment.content_id = "Balance Sheet" return attachment @@ -95,9 +95,9 @@ def build_attachment1(): def build_attachment2(): """Build attachment mock.""" attachment = Attachment() - attachment.content = "BwdW" - attachment.type = "image/png" - attachment.filename = "banner.png" + attachment.file_content = "BwdW" + attachment.file_type = "image/png" + attachment.file_name = "banner.png" attachment.disposition = "inline" attachment.content_id = "Banner" return attachment @@ -227,19 +227,19 @@ def build_kitchen_sink(): ] message.attachment = Attachment(FileContent('base64 encoded content 1'), - FileType('application/pdf'), FileName('balance_001.pdf'), + FileType('application/pdf'), Disposition('attachment'), ContentId('Content ID 1')) message.attachment = [ Attachment(FileContent('base64 encoded content 2'), - FileType('image/png'), FileName('banner.png'), + FileType('image/png'), Disposition('inline'), ContentId('Content ID 2')), Attachment(FileContent('base64 encoded content 3'), - FileType('image/png'), FileName('banner2.png'), + FileType('image/png'), Disposition('inline'), ContentId('Content ID 3')) ] From 0c139aaeb8c188b5a06bb1c73ae80d59367b7e80 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Tue, 15 Sep 2020 15:00:28 -0500 Subject: [PATCH 096/237] docs: update the eventwebhook sample data --- test/test_eventwebhook.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/test/test_eventwebhook.py b/test/test_eventwebhook.py index 28f9ad282..eee1eabf9 100644 --- a/test/test_eventwebhook.py +++ b/test/test_eventwebhook.py @@ -7,14 +7,22 @@ class UnitTests(unittest.TestCase): @classmethod def setUpClass(cls): - cls.PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEDr2LjtURuePQzplybdC+u4CwrqDqBaWjcMMsTbhdbcwHBcepxo7yAQGhHPTnlvFYPAZFceEu/1FwCM/QmGUhA==' - cls.SIGNATURE = 'MEUCIQCtIHJeH93Y+qpYeWrySphQgpNGNr/U+UyUlBkU6n7RAwIgJTz2C+8a8xonZGi6BpSzoQsbVRamr2nlxFDWYNH2j/0=' - cls.TIMESTAMP = '1588788367' - cls.PAYLOAD = json.dumps({ - 'event': 'test_event', - 'category': 'example_payload', - 'message_id': 'message_id', - }, sort_keys=True, separators=(',', ':')) + cls.PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE83T4O/n84iotIvIW4mdBgQ/7dAfSmpqIM8kF9mN1flpVKS3GRqe62gw+2fNNRaINXvVpiglSI8eNEc6wEA3F+g==' + cls.SIGNATURE = 'MEUCIGHQVtGj+Y3LkG9fLcxf3qfI10QysgDWmMOVmxG0u6ZUAiEAyBiXDWzM+uOe5W0JuG+luQAbPIqHh89M15TluLtEZtM=' + cls.TIMESTAMP = '1600112502' + cls.PAYLOAD = json.dumps( + [ + { + 'email': 'hello@world.com', + 'event': 'dropped', + 'reason': 'Bounced Address', + 'sg_event_id': 'ZHJvcC0xMDk5NDkxOS1MUnpYbF9OSFN0T0doUTRrb2ZTbV9BLTA', + 'sg_message_id': 'LRzXl_NHStOGhQ4kofSm_A.filterdrecv-p3mdw1-756b745b58-kmzbl-18-5F5FC76C-9.0', + 'smtp-id': '', + 'timestamp': 1600112492, + } + ], sort_keys=True, separators=(',', ':') + ) + '\r\n' # Be sure to include the trailing carriage return and newline! def test_verify_valid_signature(self): ew = EventWebhook() From 6980cf8eb3978aa16b21d41bcd117043d64cf057 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 16 Sep 2020 23:29:55 +0000 Subject: [PATCH 097/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d01488a7b..3c8128f10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-09-16] Version 6.4.7 +-------------------------- +**Library - Docs** +- [PR #936](https://github.com/sendgrid/sendgrid-python/pull/936): correct attachment example. Thanks to [@Arbitrage0](https://github.com/Arbitrage0)! + + [2020-08-19] Version 6.4.6 -------------------------- **Library - Chore** From e796a3f94cfbbe6f5e94f2cb74b70e4ca3a1eef0 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 16 Sep 2020 23:34:15 +0000 Subject: [PATCH 098/237] Release 6.4.7 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index a8b77c27e..63521b92e 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.6' +__version__ = '6.4.7' From 397a57da6e09ce5058f79562e19d518fdd850244 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 21 Sep 2020 10:25:30 -0500 Subject: [PATCH 099/237] docs: update legacy/dynamic transactional template doc links --- use_cases/legacy_templates.md | 4 ++-- use_cases/transactional_templates.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/use_cases/legacy_templates.md b/use_cases/legacy_templates.md index c1c9204fa..c8188a257 100644 --- a/use_cases/legacy_templates.md +++ b/use_cases/legacy_templates.md @@ -1,6 +1,6 @@ # Legacy Templates -For this example, we assume you have created a [legacy template](https://sendgrid.com/docs/ui//sending-email/create-and-edit-legacy-transactional-templates). Following is the template content we used for testing. +For this example, we assume you have created a [legacy transactional template](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html) in the UI or via the API. Following is the template content we used for testing. Template ID (replace with your own): @@ -113,4 +113,4 @@ except urllib.HTTPError as e: print(response.status_code) print(response.body) print(response.headers) -``` \ No newline at end of file +``` diff --git a/use_cases/transactional_templates.md b/use_cases/transactional_templates.md index 2a237b946..9ee4848c3 100644 --- a/use_cases/transactional_templates.md +++ b/use_cases/transactional_templates.md @@ -1,6 +1,6 @@ # Transactional Templates -For this example, we assume you have created a [transactional template](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html) in the UI or via the API. Following is the template content we used for testing. +For this example, we assume you have created a [dynamic transactional template](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) in the UI or via the API. Following is the template content we used for testing. Email Subject: From e5253a571c1537f51be3a9e16057187cb7386653 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Wed, 14 Oct 2020 15:53:28 -0500 Subject: [PATCH 100/237] chore: fix spelling typos --- FIRST_TIMERS.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index f6406f783..528580c34 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -61,13 +61,13 @@ Before creating a pull request, make sure that you respect the repository's cons * [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) * [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) * [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Python STMPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP STMPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# STMPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby STMPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Node.js STMPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java STMPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go STMPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Python SMTPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [PHP SMTPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [C# SMTPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Ruby SMTPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Node.js SMTPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Java SMTPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) +* [Go SMTPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) * [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) * [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) * [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) From 16497e920a9be4b01d712864180aee90ab3bf78e Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 15 Oct 2020 16:25:23 +0000 Subject: [PATCH 101/237] chore: update template files --- PULL_REQUEST_TEMPLATE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index a86818029..46d80c650 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -19,13 +19,13 @@ Closes #2 A short description of what this PR does. ### Checklist -- [ ] I acknowledge that all my contributions will be made under the project's license +- [x] I acknowledge that all my contributions will be made under the project's license - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) -- [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them +- [ ] I have read the [Contribution Guidelines](https://github.com/sendgrid/sendgrid-python/blob/main/CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] I have added necessary documentation about the functionality in the appropriate .md file +- [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. From 9e52a66a61aeccbec7a773be1f8c28fd144994a2 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 15 Oct 2020 16:35:17 +0000 Subject: [PATCH 102/237] chore: update template files --- PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 46d80c650..05c4d872c 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -28,4 +28,4 @@ A short description of what this PR does. - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified -If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. +If you have questions, please file a [support ticket](https://support.sendgrid.com/hc/en-us), or create a GitHub Issue in this repository. From a453cec35d0de18b5735ff9648b62f8325da4e0e Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 15 Oct 2020 21:28:41 +0000 Subject: [PATCH 103/237] chore: update template files --- PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 05c4d872c..7c2789ae4 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -28,4 +28,4 @@ A short description of what this PR does. - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified -If you have questions, please file a [support ticket](https://support.sendgrid.com/hc/en-us), or create a GitHub Issue in this repository. +If you have questions, please file a [support ticket](https://support.sendgrid.com), or create a GitHub Issue in this repository. From b42050cb84d6971b73f9cf35d5a996b6fdfd7201 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 27 Oct 2020 21:34:26 +0000 Subject: [PATCH 104/237] chore: update template files --- LICENSE.md => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => LICENSE (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE From b360223622418216f89a98278cfa1cde3e2a9ceb Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Tue, 27 Oct 2020 16:42:33 -0500 Subject: [PATCH 105/237] chore: update license references --- MANIFEST.in | 2 +- README.md | 4 ++-- README.rst | 4 ++-- test/test_project.py | 4 ++-- test/test_sendgrid.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index cd3c5f680..bf5b007ea 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include README.rst -include LICENSE.md +include LICENSE include app.json include Procfile include requirements.txt diff --git a/README.md b/README.md index f6f8c76bc..62c79bb31 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) [![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python) -[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) +[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors) [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-python/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-python) @@ -221,4 +221,4 @@ If you've instead found a bug in the library or would like new features added, g # License -[The MIT License (MIT)](LICENSE.md) +[The MIT License (MIT)](LICENSE) diff --git a/README.rst b/README.rst index cd2c6bbac..ba131179c 100644 --- a/README.rst +++ b/README.rst @@ -286,7 +286,7 @@ License .. _Improvements to the Codebase: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#improvements-to-the-codebase .. _Review Pull Requests: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#code-reviews .. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md -.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/HEAD/LICENSE.md +.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/HEAD/LICENSE .. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=main :target: https://travis-ci.org/sendgrid/sendgrid-python @@ -301,7 +301,7 @@ License .. |Email Notifications Badge| image:: https://dx.sendgrid.com/badge/python :target: https://dx.sendgrid.com/newsletter/python .. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg - :target: ./LICENSE.md + :target: ./LICENSE .. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow :target: https://twitter.com/sendgrid .. |GitHub contributors| image:: https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg diff --git a/test/test_project.py b/test/test_project.py index 79f27972d..e30049a3f 100644 --- a/test/test_project.py +++ b/test/test_project.py @@ -35,9 +35,9 @@ def test_contributing(self): def test_issue_template(self): self.assertTrue(os.path.isfile('./ISSUE_TEMPLATE.md')) - # ./LICENSE.md + # ./LICENSE def test_license(self): - self.assertTrue(os.path.isfile('./LICENSE.md')) + self.assertTrue(os.path.isfile('./LICENSE')) # ./PULL_REQUEST_TEMPLATE.md def test_pr_template(self): diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index eb9ebabb3..f6177a7d5 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -2297,7 +2297,7 @@ def test_whitelabel_links__link_id__subuser_post(self): self.assertEqual(response.status_code, 200) def test_license_year(self): - LICENSE_FILE = 'LICENSE.md' + LICENSE_FILE = 'LICENSE' copyright_line = '' with open(LICENSE_FILE, 'r') as f: for line in f: From f3d78389f2b088d061eebef8d027d706378d552d Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Fri, 30 Oct 2020 14:17:14 -0700 Subject: [PATCH 106/237] chore: update badge --- README.md | 2 +- README.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62c79bb31..de23ef2f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![SendGrid Logo](twilio_sendgrid_logo.png) -[![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=main)](https://travis-ci.org/sendgrid/sendgrid-python) +[![Travis Badge](https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-python) [![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) [![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python) diff --git a/README.rst b/README.rst index ba131179c..a7a076c22 100644 --- a/README.rst +++ b/README.rst @@ -288,8 +288,8 @@ License .. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md .. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/HEAD/LICENSE -.. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=main - :target: https://travis-ci.org/sendgrid/sendgrid-python +.. |Travis Badge| image:: https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main + :target: https://travis-ci.com/sendgrid/sendgrid-python .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/sendgrid.svg :target: https://pypi.org/project/sendgrid/ .. |PyPI Version| image:: https://img.shields.io/pypi/v/sendgrid.svg From 3e40d3cc1014cfc153920bb8c489cfcbf0d3b3db Mon Sep 17 00:00:00 2001 From: Razvan Dimescu Date: Mon, 30 Nov 2020 21:57:12 +0200 Subject: [PATCH 107/237] docs: fixed typo in sendgrid/helpers/mail/file_content.py (#955) --- sendgrid/helpers/mail/file_content.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/file_content.py b/sendgrid/helpers/mail/file_content.py index c5c0d6995..c1eb81fc6 100644 --- a/sendgrid/helpers/mail/file_content.py +++ b/sendgrid/helpers/mail/file_content.py @@ -31,7 +31,7 @@ def file_content(self, value): def get(self): """ - Get a JSON-ready representation of this FileContente. + Get a JSON-ready representation of this FileContent. :returns: This FileContent, ready for use in a request body. :rtype: string From 841088f0ef63c50d3ed51a74e82a172151a7016e Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 2 Dec 2020 19:55:02 +0000 Subject: [PATCH 108/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c8128f10..275cdcbc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2020-12-02] Version 6.4.8 +-------------------------- +**Library - Docs** +- [PR #955](https://github.com/sendgrid/sendgrid-python/pull/955): fixed typo in sendgrid/helpers/mail/file_content.py. Thanks to [@razvandimescu](https://github.com/razvandimescu)! + + [2020-09-16] Version 6.4.7 -------------------------- **Library - Docs** From 62315e699555fb78173edf2e2acbb510eab9aa18 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 2 Dec 2020 19:59:43 +0000 Subject: [PATCH 109/237] Release 6.4.8 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 63521b92e..bec64b5d2 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.7' +__version__ = '6.4.8' From 74293fd053e7d8da87e7714dba009aa3db3602d5 Mon Sep 17 00:00:00 2001 From: Michael Kennedy Date: Mon, 28 Dec 2020 13:40:53 -0800 Subject: [PATCH 110/237] docs: Sending HTML email example is broken (#962) --- use_cases/sending_html_content.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/use_cases/sending_html_content.md b/use_cases/sending_html_content.md index ba38b19aa..4a828e737 100644 --- a/use_cases/sending_html_content.md +++ b/use_cases/sending_html_content.md @@ -35,14 +35,13 @@ html_text = """ sendgrid_client = SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) from_email = From("from_email@exmaple.com") -to_email = Email("to_email@example.com") +to_email = To("to_email@example.com") subject = Subject("Test Subject") html_content = HtmlContent(html_text) soup = BeautifulSoup(html_text) plain_text = soup.get_text() plain_text_content = Content("text/plain", plain_text) -mail.add_content(plain_content) message = Mail(from_email, to_email, subject, plain_text_content, html_content) @@ -54,4 +53,4 @@ try: except urllib.HTTPError as e: print(e.read()) exit() -``` \ No newline at end of file +``` From 6807622981ec37abb05c8c247a6a6fbbab2a0f9f Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 6 Jan 2021 18:18:37 +0000 Subject: [PATCH 111/237] chore: update template files --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 29aba592a..e5439a92d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2020, Twilio SendGrid, Inc. +Copyright (C) 2021, Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 39844d63dd9023adaee5da79b372b1aee8fbee0a Mon Sep 17 00:00:00 2001 From: arun tvs Date: Sat, 9 Jan 2021 03:31:27 +0530 Subject: [PATCH 112/237] feat: Support for AMP HTML Email (#945) --- sendgrid/helpers/mail/__init__.py | 1 + sendgrid/helpers/mail/amp_html_content.py | 59 +++++ sendgrid/helpers/mail/content.py | 6 +- sendgrid/helpers/mail/mail.py | 23 +- sendgrid/helpers/mail/mime_type.py | 1 + test/test_mail_helpers.py | 267 ++++++++++++++++++++++ use_cases/sending_amp_html_content.md | 102 +++++++++ 7 files changed, 454 insertions(+), 5 deletions(-) create mode 100644 sendgrid/helpers/mail/amp_html_content.py create mode 100644 use_cases/sending_amp_html_content.md diff --git a/sendgrid/helpers/mail/__init__.py b/sendgrid/helpers/mail/__init__.py index 15cc1cc7e..28d80ac18 100644 --- a/sendgrid/helpers/mail/__init__.py +++ b/sendgrid/helpers/mail/__init__.py @@ -27,6 +27,7 @@ from .groups_to_display import GroupsToDisplay from .header import Header from .html_content import HtmlContent +from .amp_html_content import AmpHtmlContent from .ip_pool_name import IpPoolName from .mail_settings import MailSettings from .mail import Mail diff --git a/sendgrid/helpers/mail/amp_html_content.py b/sendgrid/helpers/mail/amp_html_content.py new file mode 100644 index 000000000..1a282053f --- /dev/null +++ b/sendgrid/helpers/mail/amp_html_content.py @@ -0,0 +1,59 @@ +from .content import Content +from .validators import ValidateApiKey + + +class AmpHtmlContent(Content): + """AMP HTML content to be included in your email.""" + + def __init__(self, content): + """Create an AMP HTML Content with the specified MIME type and content. + + :param content: The AMP HTML content. + :type content: string + """ + self._content = None + self._validator = ValidateApiKey() + + if content is not None: + self.content = content + + @property + def mime_type(self): + """The MIME type for AMP HTML content. + + :rtype: string + """ + return "text/x-amp-html" + + @property + def content(self): + """The actual AMP HTML content. + + :rtype: string + """ + return self._content + + @content.setter + def content(self, value): + """The actual AMP HTML content. + + :param value: The actual AMP HTML content. + :type value: string + """ + self._validator.validate_message_dict(value) + self._content = value + + def get(self): + """ + Get a JSON-ready representation of this AmpContent. + + :returns: This AmpContent, ready for use in a request body. + :rtype: dict + """ + content = {} + if self.mime_type is not None: + content["type"] = self.mime_type + + if self.content is not None: + content["value"] = self.content + return content diff --git a/sendgrid/helpers/mail/content.py b/sendgrid/helpers/mail/content.py index 73bf9f64d..618eee917 100644 --- a/sendgrid/helpers/mail/content.py +++ b/sendgrid/helpers/mail/content.py @@ -29,7 +29,7 @@ def __init__(self, mime_type, content): @property def mime_type(self): """The MIME type of the content you are including in your email. - For example, "text/plain" or "text/html". + For example, "text/plain" or "text/html" or "text/x-amp-html". :rtype: string """ @@ -38,11 +38,11 @@ def mime_type(self): @mime_type.setter def mime_type(self, value): """The MIME type of the content you are including in your email. - For example, "text/plain" or "text/html". + For example, "text/plain" or "text/html" or "text/x-amp-html". :param value: The MIME type of the content you are including in your email. - For example, "text/plain" or "text/html". + For example, "text/plain" or "text/html" or "text/x-amp-html". :type value: string """ self._mime_type = value diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index db2399310..0069a3f7d 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -27,6 +27,7 @@ def __init__( subject=None, plain_text_content=None, html_content=None, + amp_html_content=None, global_substitutions=None, is_multiple=False): """ @@ -43,6 +44,8 @@ def __init__( :type plain_text_content: string, optional :param html_content: The html body of the email :type html_content: string, optional + :param amp_html_content: The amp-html body of the email + :type amp_html_content: string, optional """ self._attachments = None self._categories = None @@ -71,6 +74,8 @@ def __init__( self.subject = subject if plain_text_content is not None: self.add_content(plain_text_content, MimeType.text) + if amp_html_content is not None: + self.add_content(amp_html_content, MimeType.amp) if html_content is not None: self.add_content(html_content, MimeType.html) @@ -725,9 +730,23 @@ def add_content(self, content, mime_type=None): """ if isinstance(content, str): content = Content(mime_type, content) - # Content of mime type text/plain must always come first - if content.mime_type == "text/plain": + # Content of mime type text/plain must always come first, followed by text/x-amp-html and then text/html + if content.mime_type == MimeType.text: self._contents = self._ensure_insert(content, self._contents) + elif content.mime_type == MimeType.amp: + if self._contents: + for _content in self._contents: + # this is written in the context that plain text content will always come earlier than the html content + if _content.mime_type == MimeType.text: + index = 1 + break + elif _content.mime_type == MimeType.html: + index = 0 + break + else: + index = 0 + self._contents = self._ensure_append( + content, self._contents, index=index) else: if self._contents: index = len(self._contents) diff --git a/sendgrid/helpers/mail/mime_type.py b/sendgrid/helpers/mail/mime_type.py index 0d0c9b3b3..a2f88c5af 100644 --- a/sendgrid/helpers/mail/mime_type.py +++ b/sendgrid/helpers/mail/mime_type.py @@ -3,3 +3,4 @@ class MimeType(object): """ text = "text/plain" html = "text/html" + amp = "text/x-amp-html" diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index 202d3948b..d0d09c9d3 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -17,6 +17,40 @@ Subject, Substitution, To, Cc, Bcc, TrackingSettings ) +# The below amp html email content is taken from [Google AMP Hello World Email](https://amp.dev/documentation/examples/introduction/hello_world_email/) +amp_html_content = '''

Hello!

''' + +response_content_with_all_three_mime_contents = json.dumps({ + "content": [ + { + "type": "text/plain", + "value": "and easy to do anywhere, even with Python" + }, + { + "type": "text/x-amp-html", + "value": amp_html_content + }, + { + "type": "text/html", + "value": "and easy to do anywhere, even with Python" + } + ], + "from": { + "email": "test+from@example.com", + "name": "Example From Name" + }, + "personalizations": [ + { + "to": [ + { + "email": "test+to@example.com", + "name": "Example To Name" + } + ] + } + ], + "subject": "Sending with SendGrid is Fun" +}) class UnitTests(unittest.TestCase): @@ -284,6 +318,239 @@ def test_multiple_emails_to_multiple_recipients(self): }''') ) + def test_single_email_with_all_three_email_contents_to_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + amp_html_content=AmpHtmlContent(amp_html_content), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python') + ) + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + def test_single_email_with_amp_and_html_contents_to_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun'), + amp_html_content=AmpHtmlContent(amp_html_content), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python') + ) + + response_content = json.dumps({ + "content": [ + { + "type": "text/x-amp-html", + "value": amp_html_content + }, + { + "type": "text/html", + "value": "and easy to do anywhere, even with Python" + } + ], + "from": { + "email": "test+from@example.com", + "name": "Example From Name" + }, + "personalizations": [ + { + "to": [ + { + "email": "test+to@example.com", + "name": "Example To Name" + } + ] + } + ], + "subject": "Sending with SendGrid is Fun" + }) + self.assertEqual( + message.get(), + json.loads(response_content) + ) + + def test_single_email_with_amp_and_plain_contents_to_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + amp_html_content=AmpHtmlContent(amp_html_content) + ) + + response_content = json.dumps({ + "content": [ + { + "type": "text/plain", + "value": "and easy to do anywhere, even with Python" + }, + { + "type": "text/x-amp-html", + "value": amp_html_content + } + ], + "from": { + "email": "test+from@example.com", + "name": "Example From Name" + }, + "personalizations": [ + { + "to": [ + { + "email": "test+to@example.com", + "name": "Example To Name" + } + ] + } + ], + "subject": "Sending with SendGrid is Fun" + }) + self.assertEqual( + message.get(), + json.loads(response_content) + ) + + ## Check ordering of MIME types in different variants - start + def test_single_email_with_all_three_contents_in_collapsed_order_of_plain_amp_html_content_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun') + ) + message.content = PlainTextContent( + 'and easy to do anywhere, even with Python') + message.content = AmpHtmlContent(amp_html_content) + message.content = HtmlContent( + 'and easy to do anywhere, even with Python') + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + def test_single_email_with_all_three_contents_in_collapsed_order_of_plain_html_amp_content_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun') + ) + message.content = PlainTextContent( + 'and easy to do anywhere, even with Python') + message.content = HtmlContent( + 'and easy to do anywhere, even with Python') + message.content = AmpHtmlContent(amp_html_content) + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + def test_single_email_with_all_three_contents_in_collapsed_order_of_html_plain_amp_content_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun') + ) + message.content = HtmlContent( + 'and easy to do anywhere, even with Python') + message.content = PlainTextContent( + 'and easy to do anywhere, even with Python') + message.content = AmpHtmlContent(amp_html_content) + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + def test_single_email_with_all_three_contents_in_collapsed_order_of_html_amp_plain_content_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun') + ) + message.content = HtmlContent( + 'and easy to do anywhere, even with Python') + message.content = AmpHtmlContent(amp_html_content) + message.content = PlainTextContent( + 'and easy to do anywhere, even with Python') + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + def test_single_email_with_all_three_contents_in_collapsed_order_of_amp_html_plain_content_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun') + ) + message.content = AmpHtmlContent(amp_html_content) + message.content = HtmlContent( + 'and easy to do anywhere, even with Python') + message.content = PlainTextContent( + 'and easy to do anywhere, even with Python') + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + def test_single_email_with_all_three_contents_in_collapsed_order_of_amp_plain_html_content_single_recipient(self): + from sendgrid.helpers.mail import (Mail, From, To, Subject, + PlainTextContent, HtmlContent, AmpHtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun') + ) + message.content = AmpHtmlContent(amp_html_content) + message.content = PlainTextContent( + 'and easy to do anywhere, even with Python') + message.content = HtmlContent( + 'and easy to do anywhere, even with Python') + + self.assertEqual( + message.get(), + json.loads(response_content_with_all_three_mime_contents) + ) + + ## end + def test_value_error_is_raised_on_to_emails_set_to_list_of_lists(self): from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) self.maxDiff = None diff --git a/use_cases/sending_amp_html_content.md b/use_cases/sending_amp_html_content.md new file mode 100644 index 000000000..616b52039 --- /dev/null +++ b/use_cases/sending_amp_html_content.md @@ -0,0 +1,102 @@ +# Sending AMP-HTML Email + +Following is an example on how to send an AMP HTML Email. +Currently, we require AMP HTML and any one of HTML or Plain Text content (preferrably both) for improved deliverability or fallback for AMP HTML Email for supporting older clients and showing alternate content after 30 days. + +For more information on AMP emails pls check the [official AMP email page](https://amp.dev/about/email/) + +```python +import os +from sendgrid import SendGridAPIClient +from sendgrid.helpers.mail import Mail + +# The below amp html email is taken from [Google AMP Hello World Email](https://amp.dev/documentation/examples/introduction/hello_world_email/) +amp_html_content = ''' + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Hello!

+ + + + + + + + +
+ + +''' + +message = Mail( + from_email='example@example.com', + to_emails='example@example.com', + subject='Sending with Twilio SendGrid is Fun', + html_content='and easy to do anywhere, even with Python', + amp_html_content=amp_html_content) +try: + sg = SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) + response = sg.send(message) + print(response.status_code) + print(response.body) + print(response.headers) +except Exception as e: + print(e.message) +``` \ No newline at end of file From 92ad033da0a7f843eb138469b026ef3578ff62ca Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 13 Jan 2021 20:20:17 +0000 Subject: [PATCH 113/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 275cdcbc9..eba273953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-01-13] Version 6.5.0 +-------------------------- +**Library - Feature** +- [PR #945](https://github.com/sendgrid/sendgrid-python/pull/945): Support for AMP HTML Email. Thanks to [@modernwarfareuplink](https://github.com/modernwarfareuplink)! + +**Library - Docs** +- [PR #962](https://github.com/sendgrid/sendgrid-python/pull/962): Sending HTML email example is broken. Thanks to [@mikeckennedy](https://github.com/mikeckennedy)! + + [2020-12-02] Version 6.4.8 -------------------------- **Library - Docs** From bea36da8ecd535f22d266a3a7f2bd6377af7d7cf Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 13 Jan 2021 20:24:49 +0000 Subject: [PATCH 114/237] Release 6.5.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index bec64b5d2..4a09e5e87 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.4.8' +__version__ = '6.5.0' From fdf5c497767382879134175e21867c851905e792 Mon Sep 17 00:00:00 2001 From: John Calhoun Date: Fri, 29 Jan 2021 15:48:09 -0800 Subject: [PATCH 115/237] feat: remove duplicate emails ignoring case in Personalization (#924) Co-authored-by: childish-sambino Co-authored-by: Elmer Thomas Co-authored-by: Elise Shanholtz --- sendgrid/helpers/mail/personalization.py | 20 ++- test/test_mail_helpers.py | 218 +++++++++++++++++++++++ 2 files changed, 235 insertions(+), 3 deletions(-) diff --git a/sendgrid/helpers/mail/personalization.py b/sendgrid/helpers/mail/personalization.py index 9239f9458..21a31c863 100644 --- a/sendgrid/helpers/mail/personalization.py +++ b/sendgrid/helpers/mail/personalization.py @@ -27,6 +27,20 @@ def add_email(self, email): self.add_bcc(email) return raise ValueError('Please use a To, Cc or Bcc object.') + + def _get_unique_recipients(self, recipients): + unique_recipients = [] + + for recipient in recipients: + recipient_email = recipient['email'].lower() if isinstance(recipient, dict) else recipient.email.lower() + if all( + unique_recipient['email'].lower() != recipient_email for unique_recipient in unique_recipients + ): + new_unique_recipient = recipient if isinstance(recipient, dict) else recipient.get() + unique_recipients.append(new_unique_recipient) + + return unique_recipients + @property def tos(self): @@ -34,7 +48,7 @@ def tos(self): :rtype: list(dict) """ - return self._tos + return self._get_unique_recipients(self._tos) @tos.setter def tos(self, value): @@ -69,7 +83,7 @@ def ccs(self): :rtype: list(dict) """ - return self._ccs + return self._get_unique_recipients(self._ccs) @ccs.setter def ccs(self, value): @@ -89,7 +103,7 @@ def bccs(self): :rtype: list(dict) """ - return self._bccs + return self._get_unique_recipients(self._bccs) @bccs.setter def bccs(self, value): diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index d0d09c9d3..752a9fd85 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -646,6 +646,224 @@ def test_error_is_not_raised_on_to_emails_includes_bcc_cc(self): html_content=HtmlContent( 'and easy to do anywhere, even with Python')) + def test_personalization_add_email_filters_out_duplicate_to_emails(self): + self.maxDiff = None + + p = Personalization() + to_email = To('test+to0@example.com', 'Example To Name 0') + p.add_email(to_email) + p.add_email(to_email) + + self.assertEqual([to_email.get()], p.tos) + + def test_personalization_add_email_filters_out_duplicate_to_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + to_email = To('test+to0@example.com', 'Example To Name 0') + to_email_with_caps = To('test+TO0@example.com', 'Example To Name 0') + p.add_email(to_email) + p.add_email(to_email_with_caps) + + self.assertEqual([to_email.get()], p.tos) + + def test_personalization_filters_out_duplicate_cc_emails(self): + self.maxDiff = None + + p = Personalization() + cc_email = Cc('test+cc0@example.com', 'Example Cc Name 0') + p.add_email(cc_email) + p.add_email(cc_email) + + self.assertEqual([cc_email.get()], p.ccs) + + def test_personalization_filters_out_duplicate_cc_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + cc_email = Cc('test+cc0@example.com', 'Example Cc Name 0') + cc_email_with_caps = Cc('test+CC0@example.com', 'Example Cc Name 0') + p.add_email(cc_email) + p.add_email(cc_email_with_caps) + + self.assertEqual([cc_email.get()], p.ccs) + + def test_personalization_filters_out_duplicate_bcc_emails(self): + self.maxDiff = None + + p = Personalization() + bcc_email = Bcc('test+bcc0@example.com', 'Example Bcc Name 0') + p.add_email(bcc_email) + p.add_email(bcc_email) + + self.assertEqual([bcc_email.get()], p.bccs) + + def test_personalization_filters_out_duplicate_bcc_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + bcc_email = Bcc('test+bcc0@example.com', 'Example Bcc Name 0') + bcc_email_with_caps = Bcc('test+BCC0@example.com', 'Example Bcc Name 0') + p.add_email(bcc_email) + p.add_email(bcc_email_with_caps) + + self.assertEqual([bcc_email.get()], p.bccs) + + def test_personalization_tos_setter_filters_out_duplicate_dict_emails(self): + self.maxDiff = None + + p = Personalization() + to_emails = [{ 'email': 'test+to0@example.com', 'name': 'Example To Name 0' }] * 2 + p.tos = to_emails + + self.assertEqual([to_emails[0]], p.tos) + + def test_personalization_tos_setter_filters_out_duplicate_dict_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + to_email = { 'email': 'test+to0@example.com', 'name': 'Example To Name 0' } + to_email_with_caps = { 'email': 'test+TO0@example.com', 'name': 'Example To Name 0' } + to_emails = [to_email, to_email_with_caps] + p.tos = to_emails + + self.assertEqual([to_email], p.tos) + + def test_personalization_tos_setter_filters_out_duplicate_to_emails(self): + self.maxDiff = None + + p = Personalization() + to_emails = [To('test+to0@example.com', 'Example To Name 0')] * 2 + p.tos = to_emails + + self.assertEqual([to_emails[0].get()], p.tos) + + + def test_personalization_tos_setter_filters_out_duplicate_to_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + to_email = To('test+to0@example.com', 'Example To Name 0') + to_email_with_caps = To('test+TO0@example.com', 'Example To Name 0') + to_emails = [to_email, to_email_with_caps] + p.tos = to_emails + + self.assertEqual([to_email.get()], p.tos) + + def test_personalization_ccs_setter_filters_out_duplicate_dict_emails(self): + self.maxDiff = None + + p = Personalization() + cc_emails = [{ 'email': 'test+cc0@example.com', 'name': 'Example Cc Name 0' }] * 2 + p.ccs = cc_emails + + self.assertEqual([cc_emails[0]], p.ccs) + + def test_personalization_ccs_setter_filters_out_duplicate_dict_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + cc_email = { 'email': 'test+cc0@example.com', 'name': 'Example Cc Name 0' } + cc_email_with_caps = { 'email': 'test+CC0@example.com', 'name': 'Example Cc Name 0' } + cc_emails = [cc_email, cc_email_with_caps] + p.ccs = cc_emails + + self.assertEqual([cc_email], p.ccs) + + def test_personalization_ccs_setter_filters_out_duplicate_cc_emails(self): + self.maxDiff = None + + p = Personalization() + cc_emails = [Cc('test+cc0@example.com', 'Example Cc Name 0')] * 2 + p.ccs = cc_emails + + self.assertEqual([cc_emails[0].get()], p.ccs) + + def test_personalization_ccs_setter_filters_out_duplicate_cc_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + cc_email = Cc('test+cc0@example.com', 'Example Cc Name 0') + cc_email_with_caps = Cc('test+CC0@example.com', 'Example Cc Name 0') + p.ccs = [cc_email, cc_email_with_caps] + + self.assertEqual([cc_email.get()], p.ccs) + + def test_personalization_bccs_setter_filters_out_duplicate_dict_emails(self): + self.maxDiff = None + + p = Personalization() + bcc_emails = [{ 'email': 'test+bcc0@example.com', 'name': 'Example Bcc Name 0' }] * 2 + p.bccs = bcc_emails + + self.assertEqual([bcc_emails[0]], p.bccs) + + def test_personalization_bccs_setter_filters_out_duplicate_dict_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + bcc_email = { 'email': 'test+bcc0@example.com', 'name': 'Example Bcc Name 0' } + bcc_email_with_caps = { 'email': 'test+BCC0@example.com', 'name': 'Example Bcc Name 0' } + bcc_emails = [bcc_email, bcc_email_with_caps] + p.bccs = bcc_emails + + self.assertEqual([bcc_email], p.bccs) + + def test_personalization_bccs_setter_filters_out_duplicate_bcc_emails(self): + self.maxDiff = None + + p = Personalization() + bcc_emails = [Bcc('test+bcc0@example.com', 'Example Bcc Name 0')] * 2 + p.bccs = bcc_emails + + self.assertEqual([bcc_emails[0].get()], p.bccs) + + def test_personalization_bccs_setter_filters_out_duplicate_bcc_emails_ignoring_case(self): + self.maxDiff = None + + p = Personalization() + bcc_email = Bcc('test+bcc0@example.com', 'Example Bcc Name 0') + bcc_email_with_caps = Bcc('test+BCC0@example.com', 'Example Bcc Name 0') + p.bccs = [bcc_email, bcc_email_with_caps] + + self.assertEqual([bcc_email.get()], p.bccs) + + def test_personalization_add_to_filters_out_duplicate_to_emails(self): + self.maxDiff = None + + p = Personalization() + to_email = To('test+to0@example.com', 'Example To Name 0') + p.add_to(to_email) + p.add_to(to_email) + + expected = [to_email.get()] + + self.assertEqual(expected, p.tos) + + def test_personalization_add_bcc_filters_out_duplicate_bcc_emails(self): + self.maxDiff = None + + p = Personalization() + bcc_email = Bcc('test+to0@example.com', 'Example To Name 0') + p.add_bcc(bcc_email) + p.add_bcc(bcc_email) + + expected = [bcc_email.get()] + + self.assertEqual(expected, p.bccs) + + def test_personalization_add_cc_filters_out_duplicate_cc_emails(self): + self.maxDiff = None + + p = Personalization() + cc_email = Cc('test+to0@example.com', 'Example To Name 0') + p.add_cc(cc_email) + p.add_cc(cc_email) + + expected = [cc_email.get()] + + self.assertEqual(expected, p.ccs) + def test_dynamic_template_data(self): self.maxDiff = None From eb3014bdcb3de287c6155f37502a5fb80ed01716 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Sat, 6 Feb 2021 06:57:42 +0530 Subject: [PATCH 116/237] docs: Use correct pip installation command (#964) --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 589aa2e6a..b9a68b8c0 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -72,7 +72,7 @@ Using pip: ```bash pip uninstall sendgrid -pip install sendgrid=1.6.22 +pip install sendgrid==1.6.22 ``` Download: From 3f97a7fed7b48d7cbe3b80db81abf5bb170bf102 Mon Sep 17 00:00:00 2001 From: Ben Lopatin Date: Fri, 5 Feb 2021 20:29:19 -0500 Subject: [PATCH 117/237] fix: replace names in BatchId docstrings (#971) --- sendgrid/helpers/mail/batch_id.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sendgrid/helpers/mail/batch_id.py b/sendgrid/helpers/mail/batch_id.py index de9960ca2..a4c0f8e9d 100644 --- a/sendgrid/helpers/mail/batch_id.py +++ b/sendgrid/helpers/mail/batch_id.py @@ -18,7 +18,7 @@ def __init__(self, batch_id=None): @property def batch_id(self): - """A unix timestamp. + """The batch ID. :rtype: string """ @@ -26,7 +26,7 @@ def batch_id(self): @batch_id.setter def batch_id(self, value): - """A unix timestamp. + """The batch ID. :param value: Batch Id :type value: string @@ -42,7 +42,7 @@ def __str__(self): def get(self): """ - Get a JSON-ready representation of this SendAt object. + Get a JSON-ready representation of this BatchId object. :returns: The BatchId, ready for use in a request body. :rtype: string From 7821d42f683b44e51c7285c9dc47ee94fe3ee8f4 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 10 Feb 2021 22:56:08 +0000 Subject: [PATCH 118/237] [Librarian] Version Bump --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eba273953..b9344367e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-02-10] Version 6.6.0 +-------------------------- +**Library - Docs** +- [PR #964](https://github.com/sendgrid/sendgrid-python/pull/964): Use correct pip installation command. Thanks to [@Akasurde](https://github.com/Akasurde)! + +**Library - Fix** +- [PR #971](https://github.com/sendgrid/sendgrid-python/pull/971): replace names in BatchId docstrings. Thanks to [@bennylope](https://github.com/bennylope)! + +**Library - Feature** +- [PR #924](https://github.com/sendgrid/sendgrid-python/pull/924): remove duplicate emails ignoring case in Personalization. Thanks to [@DougCal](https://github.com/DougCal)! + + [2021-01-13] Version 6.5.0 -------------------------- **Library - Feature** From 4606b8557eb30e5972dfcf1b2e00498c75179ae5 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 10 Feb 2021 23:13:00 +0000 Subject: [PATCH 119/237] Release 6.6.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 4a09e5e87..ce16fc2fb 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.5.0' +__version__ = '6.6.0' From 423f2d07766f59507c3c19e289ac346ad6978ba7 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 8 Mar 2021 23:24:31 -0800 Subject: [PATCH 120/237] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index de23ef2f6..880589c81 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,8 @@ Please see [our helper](sendgrid/helpers/inbound) for utilizing our Inbound Pars # Announcements +Our Developer Experience team is conducting planned maintenance from 03/09/2021 until 03/11/2021. Our next release is scheduled for 03/15/2021. + Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated! All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. From 3e718fb689d75bfc6c509aa88d7f39214e8bed91 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 12 Mar 2021 20:35:37 +0000 Subject: [PATCH 121/237] chore: update template files --- .github/ISSUE_TEMPLATE/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..afcba3446 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +contact_links: + - name: Twilio SendGrid Support + url: https://support.sendgrid.com + about: Get Support + - name: Stack Overflow + url: https://stackoverflow.com/questions/tagged/sendgrid-python+or+sendgrid+python + about: Ask questions on Stack Overflow + - name: Documentation + url: https://sendgrid.com/docs/for-developers/ + about: View Reference Documentation From 38b0ad658a369694471e62808b4e7e3b80520899 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 15 Mar 2021 12:48:21 -0700 Subject: [PATCH 122/237] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 880589c81..de23ef2f6 100644 --- a/README.md +++ b/README.md @@ -189,8 +189,6 @@ Please see [our helper](sendgrid/helpers/inbound) for utilizing our Inbound Pars # Announcements -Our Developer Experience team is conducting planned maintenance from 03/09/2021 until 03/11/2021. Our next release is scheduled for 03/15/2021. - Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated! All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. From 16eb0c33c97f8ca293fbc0d8965afd87c0d2f99a Mon Sep 17 00:00:00 2001 From: Alex Narayanan <67122654+anarayanan604@users.noreply.github.com> Date: Fri, 9 Apr 2021 19:02:50 -0400 Subject: [PATCH 123/237] feat: add v3 bypass filters (#983) --- sendgrid/helpers/mail/__init__.py | 3 + .../helpers/mail/bypass_bounce_management.py | 48 ++++++++++ .../helpers/mail/bypass_spam_management.py | 47 ++++++++++ .../mail/bypass_unsubscribe_management.py | 49 +++++++++++ sendgrid/helpers/mail/mail_settings.py | 87 +++++++++++++++++++ test/test_mail_helpers.py | 54 +++++++++++- use_cases/kitchen_sink.md | 6 +- 7 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 sendgrid/helpers/mail/bypass_bounce_management.py create mode 100644 sendgrid/helpers/mail/bypass_spam_management.py create mode 100644 sendgrid/helpers/mail/bypass_unsubscribe_management.py diff --git a/sendgrid/helpers/mail/__init__.py b/sendgrid/helpers/mail/__init__.py index 28d80ac18..358f2d912 100644 --- a/sendgrid/helpers/mail/__init__.py +++ b/sendgrid/helpers/mail/__init__.py @@ -4,7 +4,10 @@ from .bcc_email import Bcc from .bcc_settings import BccSettings from .bcc_settings_email import BccSettingsEmail +from .bypass_bounce_management import BypassBounceManagement from .bypass_list_management import BypassListManagement +from .bypass_spam_management import BypassSpamManagement +from .bypass_unsubscribe_management import BypassUnsubscribeManagement from .category import Category from .cc_email import Cc from .click_tracking import ClickTracking diff --git a/sendgrid/helpers/mail/bypass_bounce_management.py b/sendgrid/helpers/mail/bypass_bounce_management.py new file mode 100644 index 000000000..b0a35105c --- /dev/null +++ b/sendgrid/helpers/mail/bypass_bounce_management.py @@ -0,0 +1,48 @@ +class BypassBounceManagement(object): + """Setting for Bypass Bounce Management + + + Allows you to bypass the bounce list to ensure that the email is delivered to recipients. + Spam report and unsubscribe lists will still be checked; addresses on these other lists + will not receive the message. This filter cannot be combined with the bypass_list_management filter. + """ + + def __init__(self, enable=None): + """Create a BypassBounceManagement. + + :param enable: Whether emails should bypass bounce management. + :type enable: boolean, optional + """ + self._enable = None + + if enable is not None: + self.enable = enable + + @property + def enable(self): + """Indicates if this setting is enabled. + + :rtype: boolean + """ + return self._enable + + @enable.setter + def enable(self, value): + """Indicates if this setting is enabled. + + :param value: Indicates if this setting is enabled. + :type value: boolean + """ + self._enable = value + + def get(self): + """ + Get a JSON-ready representation of this BypassBounceManagement. + + :returns: This BypassBounceManagement, ready for use in a request body. + :rtype: dict + """ + bypass_bounce_management = {} + if self.enable is not None: + bypass_bounce_management["enable"] = self.enable + return bypass_bounce_management diff --git a/sendgrid/helpers/mail/bypass_spam_management.py b/sendgrid/helpers/mail/bypass_spam_management.py new file mode 100644 index 000000000..9b2552eb9 --- /dev/null +++ b/sendgrid/helpers/mail/bypass_spam_management.py @@ -0,0 +1,47 @@ +class BypassSpamManagement(object): + """Setting for Bypass Spam Management + + Allows you to bypass the spam report list to ensure that the email is delivered to recipients. + Bounce and unsubscribe lists will still be checked; addresses on these other lists will not + receive the message. This filter cannot be combined with the bypass_list_management filter. + """ + + def __init__(self, enable=None): + """Create a BypassSpamManagement. + + :param enable: Whether emails should bypass spam management. + :type enable: boolean, optional + """ + self._enable = None + + if enable is not None: + self.enable = enable + + @property + def enable(self): + """Indicates if this setting is enabled. + + :rtype: boolean + """ + return self._enable + + @enable.setter + def enable(self, value): + """Indicates if this setting is enabled. + + :param value: Indicates if this setting is enabled. + :type value: boolean + """ + self._enable = value + + def get(self): + """ + Get a JSON-ready representation of this BypassSpamManagement. + + :returns: This BypassSpamManagement, ready for use in a request body. + :rtype: dict + """ + bypass_spam_management = {} + if self.enable is not None: + bypass_spam_management["enable"] = self.enable + return bypass_spam_management diff --git a/sendgrid/helpers/mail/bypass_unsubscribe_management.py b/sendgrid/helpers/mail/bypass_unsubscribe_management.py new file mode 100644 index 000000000..4867fac22 --- /dev/null +++ b/sendgrid/helpers/mail/bypass_unsubscribe_management.py @@ -0,0 +1,49 @@ +class BypassUnsubscribeManagement(object): + """Setting for Bypass Unsubscribe Management + + + Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. + Bounce and spam report lists will still be checked; addresses on these other lists will not receive + the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. + This filter cannot be combined with the bypass_list_management filter. + """ + + def __init__(self, enable=None): + """Create a BypassUnsubscribeManagement. + + :param enable: Whether emails should bypass unsubscribe management. + :type enable: boolean, optional + """ + self._enable = None + + if enable is not None: + self.enable = enable + + @property + def enable(self): + """Indicates if this setting is enabled. + + :rtype: boolean + """ + return self._enable + + @enable.setter + def enable(self, value): + """Indicates if this setting is enabled. + + :param value: Indicates if this setting is enabled. + :type value: boolean + """ + self._enable = value + + def get(self): + """ + Get a JSON-ready representation of this BypassUnsubscribeManagement. + + :returns: This BypassUnsubscribeManagement, ready for use in a request body. + :rtype: dict + """ + bypass_unsubscribe_management = {} + if self.enable is not None: + bypass_unsubscribe_management["enable"] = self.enable + return bypass_unsubscribe_management diff --git a/sendgrid/helpers/mail/mail_settings.py b/sendgrid/helpers/mail/mail_settings.py index 45b7db77f..78499ac30 100644 --- a/sendgrid/helpers/mail/mail_settings.py +++ b/sendgrid/helpers/mail/mail_settings.py @@ -3,7 +3,10 @@ class MailSettings(object): def __init__(self, bcc_settings=None, + bypass_bounce_management=None, bypass_list_management=None, + bypass_spam_management=None, + bypass_unsubscribe_management=None, footer_settings=None, sandbox_mode=None, spam_check=None): @@ -11,9 +14,18 @@ def __init__(self, :param bcc_settings: The BCC Settings of this MailSettings :type bcc_settings: BCCSettings, optional + :param bypass_bounce_management: Whether this MailSettings bypasses bounce management. + Should not be combined with bypass_list_management. + :type bypass_list_management: BypassBounceManagement, optional :param bypass_list_management: Whether this MailSettings bypasses list management :type bypass_list_management: BypassListManagement, optional + :param bypass_spam_management: Whether this MailSettings bypasses spam management. + Should not be combined with bypass_list_management. + :type bypass_list_management: BypassSpamManagement, optional + :param bypass_unsubscribe_management: Whether this MailSettings bypasses unsubscribe management. + Should not be combined with bypass_list_management. + :type bypass_list_management: BypassUnsubscribeManagement, optional :param footer_settings: The default footer specified by this MailSettings :type footer_settings: FooterSettings, optional @@ -24,7 +36,10 @@ def __init__(self, :type spam_check: SpamCheck, optional """ self._bcc_settings = None + self._bypass_bounce_management = None self._bypass_list_management = None + self._bypass_spam_management = None + self._bypass_unsubscribe_management = None self._footer_settings = None self._sandbox_mode = None self._spam_check = None @@ -32,9 +47,18 @@ def __init__(self, if bcc_settings is not None: self.bcc_settings = bcc_settings + if bypass_bounce_management is not None: + self.bypass_bounce_management = bypass_bounce_management + if bypass_list_management is not None: self.bypass_list_management = bypass_list_management + if bypass_spam_management is not None: + self.bypass_spam_management = bypass_spam_management + + if bypass_unsubscribe_management is not None: + self.bypass_unsubscribe_management = bypass_unsubscribe_management + if footer_settings is not None: self.footer_settings = footer_settings @@ -61,6 +85,23 @@ def bcc_settings(self, value): """ self._bcc_settings = value + @property + def bypass_bounce_management(self): + """Whether this MailSettings bypasses bounce management. + + :rtype: BypassBounceManagement + """ + return self._bypass_bounce_management + + @bypass_bounce_management.setter + def bypass_bounce_management(self, value): + """Whether this MailSettings bypasses bounce management. + + :param value: Whether this MailSettings bypasses bounce management. + :type value: BypassBounceManagement + """ + self._bypass_bounce_management = value + @property def bypass_list_management(self): """Whether this MailSettings bypasses list management. @@ -78,6 +119,40 @@ def bypass_list_management(self, value): """ self._bypass_list_management = value + @property + def bypass_spam_management(self): + """Whether this MailSettings bypasses spam management. + + :rtype: BypassSpamManagement + """ + return self._bypass_spam_management + + @bypass_spam_management.setter + def bypass_spam_management(self, value): + """Whether this MailSettings bypasses spam management. + + :param value: Whether this MailSettings bypasses spam management. + :type value: BypassSpamManagement + """ + self._bypass_spam_management = value + + @property + def bypass_unsubscribe_management(self): + """Whether this MailSettings bypasses unsubscribe management. + + :rtype: BypassUnsubscribeManagement + """ + return self._bypass_unsubscribe_management + + @bypass_unsubscribe_management.setter + def bypass_unsubscribe_management(self, value): + """Whether this MailSettings bypasses unsubscribe management. + + :param value: Whether this MailSettings bypasses unsubscribe management. + :type value: BypassUnsubscribeManagement + """ + self._bypass_unsubscribe_management = value + @property def footer_settings(self): """The default footer specified by this MailSettings. @@ -141,10 +216,22 @@ def get(self): if self.bcc_settings is not None: mail_settings["bcc"] = self.bcc_settings.get() + if self.bypass_bounce_management is not None: + mail_settings[ + "bypass_bounce_management"] = self.bypass_bounce_management.get() + if self.bypass_list_management is not None: mail_settings[ "bypass_list_management"] = self.bypass_list_management.get() + if self.bypass_spam_management is not None: + mail_settings[ + "bypass_spam_management"] = self.bypass_spam_management.get() + + if self.bypass_unsubscribe_management is not None: + mail_settings[ + "bypass_unsubscribe_management"] = self.bypass_unsubscribe_management.get() + if self.footer_settings is not None: mail_settings["footer"] = self.footer_settings.get() diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index 752a9fd85..57a4ba880 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -935,7 +935,8 @@ def test_kitchen_sink(self): FileContent, FileType, Disposition, ContentId, TemplateId, Section, ReplyTo, Category, BatchId, Asm, GroupId, GroupsToDisplay, IpPoolName, MailSettings, BccSettings, BccSettingsEmail, - BypassListManagement, FooterSettings, FooterText, + BypassBounceManagement, BypassListManagement, BypassSpamManagement, + BypassUnsubscribeManagement, FooterSettings, FooterText, FooterHtml, SandBoxMode, SpamCheck, SpamThreshold, SpamUrl, TrackingSettings, ClickTracking, SubscriptionTracking, SubscriptionText, SubscriptionHtml, SubscriptionSubstitutionTag, @@ -1116,7 +1117,10 @@ def test_kitchen_sink(self): mail_settings = MailSettings() mail_settings.bcc_settings = BccSettings( False, BccSettingsEmail("bcc@twilio.com")) + mail_settings.bypass_bounce_management = BypassBounceManagement(False) mail_settings.bypass_list_management = BypassListManagement(False) + mail_settings.bypass_spam_management = BypassSpamManagement(False) + mail_settings.bypass_unsubscribe_management = BypassUnsubscribeManagement(False) mail_settings.footer_settings = FooterSettings( True, FooterText("w00t"), FooterHtml("w00t!")) mail_settings.sandbox_mode = SandBoxMode(True) @@ -1223,9 +1227,18 @@ def test_kitchen_sink(self): "email": "bcc@twilio.com", "enable": false }, + "bypass_bounce_management": { + "enable": false + }, "bypass_list_management": { "enable": false }, + "bypass_spam_management": { + "enable": false + }, + "bypass_unsubscribe_management": { + "enable": false + }, "footer": { "enable": true, "html": "w00t!", @@ -1613,3 +1626,42 @@ def test_disable_tracking(self): tracking_settings.get(), {'click_tracking': {'enable': False, 'enable_text': False}} ) + + def test_bypass_list_management(self): + from sendgrid.helpers.mail import (MailSettings, BypassListManagement) + mail_settings = MailSettings() + mail_settings.bypass_list_management = BypassListManagement(True) + + self.assertEqual( + mail_settings.get(), + { + "bypass_list_management": { + "enable": True + }, + }, + ) + + def test_v3_bypass_filters(self): + from sendgrid.helpers.mail import ( + MailSettings, BypassBounceManagement, + BypassSpamManagement, BypassUnsubscribeManagement + ) + mail_settings = MailSettings() + mail_settings.bypass_bounce_management = BypassBounceManagement(True) + mail_settings.bypass_spam_management = BypassSpamManagement(True) + mail_settings.bypass_unsubscribe_management = BypassUnsubscribeManagement(True) + + self.assertEqual( + mail_settings.get(), + { + "bypass_bounce_management": { + "enable": True + }, + "bypass_spam_management": { + "enable": True + }, + "bypass_unsubscribe_management": { + "enable": True + }, + }, + ) diff --git a/use_cases/kitchen_sink.md b/use_cases/kitchen_sink.md index 68c9e057e..c0a301117 100644 --- a/use_cases/kitchen_sink.md +++ b/use_cases/kitchen_sink.md @@ -8,7 +8,8 @@ from sendgrid.helpers.mail import ( FileContent, FileType, Disposition, ContentId, TemplateId, Section, ReplyTo, Category, BatchId, Asm, GroupId, GroupsToDisplay, IpPoolName, MailSettings, BccSettings, BccSettingsEmail, - BypassListManagement, FooterSettings, FooterText, + BypassBounceManagement, BypassListManagement, BypassSpamManagement, + BypassUnsubscribeManagement, FooterSettings, FooterText, FooterHtml, SandBoxMode, SpamCheck, SpamThreshold, SpamUrl, TrackingSettings, ClickTracking, SubscriptionTracking, SubscriptionText, SubscriptionHtml, SubscriptionSubstitutionTag, @@ -185,7 +186,10 @@ mail_settings = MailSettings() mail_settings.bcc_settings = BccSettings( False, BccSettingsEmail("bcc@twilio.com")) +mail_settings.bypass_bounce_management = BypassBounceManagement(False) mail_settings.bypass_list_management = BypassListManagement(False) +mail_settings.bypass_spam_management = BypassSpamManagement(False) +mail_settings.bypass_unsubscribe_management = BypassUnsubscribeManagement(False) mail_settings.footer_settings = FooterSettings( True, FooterText("w00t"), From cf0924c35c37bbec8e5ca39e963a55f54f0eec11 Mon Sep 17 00:00:00 2001 From: Huong Minh Luu Date: Tue, 20 Apr 2021 07:39:15 +0930 Subject: [PATCH 124/237] docs: Update to_emails type (#986) --- sendgrid/helpers/mail/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index 0069a3f7d..ba21f7891 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -216,8 +216,8 @@ def to(self): def to(self, to_emails, global_substitutions=None, is_multiple=False, p=0): """Adds To objects to the Personalization object - :param to_emails: An To or list of To objects - :type to_emails: To, list(To), str, tuple + :param to_emails: The email addresses of all recipients + :type to_emails: To, str, tuple, list(str), list(tuple), list(To) :param global_substitutions: A dict of substitutions for all recipients :type global_substitutions: dict :param is_multiple: Create a new personalization for each recipient From f7adbc1e83c08fbd4411fa2978b326e51549551b Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 21 Apr 2021 18:45:57 +0000 Subject: [PATCH 125/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9344367e..648cecfeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-04-21] Version 6.7.0 +-------------------------- +**Library - Docs** +- [PR #986](https://github.com/sendgrid/sendgrid-python/pull/986): Update to_emails type. Thanks to [@PyGeek03](https://github.com/PyGeek03)! + +**Library - Feature** +- [PR #983](https://github.com/sendgrid/sendgrid-python/pull/983): add v3 bypass filters. Thanks to [@anarayanan604](https://github.com/anarayanan604)! + + [2021-02-10] Version 6.6.0 -------------------------- **Library - Docs** From aa39f715a061f0de993811faea0adb8223657d01 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 21 Apr 2021 18:53:46 +0000 Subject: [PATCH 126/237] Release 6.7.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index ce16fc2fb..bc09034be 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.6.0' +__version__ = '6.7.0' From 9c1b88e2f11ee2950d5be98df598c28908672a99 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Fri, 23 Apr 2021 11:10:11 -0700 Subject: [PATCH 127/237] chore: rotate key --- .travis.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c158b2b3..ea9a8fe0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,37 @@ -dist: xenial # required for Python >= 3.7 +dist: xenial language: python cache: pip services: - - docker +- docker env: matrix: - - version=2.7 - - version=3.5 - - version=3.6 - - version=3.7 - - version=3.8 + - version=2.7 + - version=3.5 + - version=3.6 + - version=3.7 + - version=3.8 global: - - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN + - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build +- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 + > ./cc-test-reporter +- chmod +x ./cc-test-reporter +- "./cc-test-reporter before-build" script: - - make test-docker +- make test-docker after_script: - - make test-install - - . venv/bin/activate; codecov - - ./cc-test-reporter after-build --exit-code $? +- make test-install +- ". venv/bin/activate; codecov" +- "./cc-test-reporter after-build --exit-code $?" deploy: provider: pypi - user: "__token__" - password: $PYPI_TOKEN + user: __token__ + password: "$PYPI_TOKEN" skip_cleanup: true distributions: sdist bdist_wheel on: tags: true - condition: $version = 3.6 - + condition: "$version = 3.6" notifications: slack: if: branch = main @@ -39,4 +39,4 @@ notifications: on_success: never on_failure: change rooms: - - secure: Yp7gJ6NPRPNgO77vwS0HynSdnU5LYlLlUNBEzcx+zy230UxuLLWcYZtIqsIqt4oZm45OwgJLBwoCMgmU2Jcj79rGyqWKYtUcLMLKgHVzSgxjm2outt2fxjXIJHIU60S3RCGofBJRkPwEMb7ibgwHYBEsH3wIeLrVVbWvimxka6A= + secure: damw3UZJAjoUy2Wsf9/DWT5XHIJ4DcRucS/sLPVEyynSRqhzJlxGL7gLQ2fdtMNDY+1fs4UhzYzpUIdu+Tz2mSdZlv1kRY5zIWwJ5JK+9PACt5wVXpKN794JGKcDXOh64Bqrd3ofXkyecI2OyTVNdcTu370K/Tlz3xhHvdBqpU0= From 2ac1dcbb86fb2e46ffba70a6038637ff4291d3ed Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 14 Jun 2021 18:08:14 -0700 Subject: [PATCH 128/237] Update Slack token --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ea9a8fe0a..bb2a49911 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,4 +39,4 @@ notifications: on_success: never on_failure: change rooms: - secure: damw3UZJAjoUy2Wsf9/DWT5XHIJ4DcRucS/sLPVEyynSRqhzJlxGL7gLQ2fdtMNDY+1fs4UhzYzpUIdu+Tz2mSdZlv1kRY5zIWwJ5JK+9PACt5wVXpKN794JGKcDXOh64Bqrd3ofXkyecI2OyTVNdcTu370K/Tlz3xhHvdBqpU0= + secure: n7ZtDd7AvPsw7Wd6fOCCWYiakWpCnYs1QqXpiozF9Rh1Z90XcrQp72utPFyl81jJp7zlgYWXSfHqmnUpbOCWd04WTsC4dkAY6dd/ThARV4kRkxONX3nlbRESOeZIWNXNOeSR1pg6sd9H7xwIDGmmN2arnFRNiQAD0y5li0yxAfQ= From 23e696bd021d44ccc158b62a0edbbf3214bc426b Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Mon, 14 Jun 2021 19:35:02 -0700 Subject: [PATCH 129/237] chore: remove logic adding quotes to names containing , and ; (#994) --- sendgrid/helpers/mail/email.py | 19 ------------------- test/test_email.py | 14 -------------- 2 files changed, 33 deletions(-) diff --git a/sendgrid/helpers/mail/email.py b/sendgrid/helpers/mail/email.py index ba3a98848..aeab26afa 100644 --- a/sendgrid/helpers/mail/email.py +++ b/sendgrid/helpers/mail/email.py @@ -3,20 +3,6 @@ except ImportError: import email.utils as rfc822 -import sys -if sys.version_info[:3] >= (3, 5, 0): - import html - html_entity_decode = html.unescape -else: - try: - # Python 2.6-2.7 - from HTMLParser import HTMLParser - except ImportError: - # Python < 3.5 - from html.parser import HTMLParser - __html_parser__ = HTMLParser() - html_entity_decode = __html_parser__.unescape - try: basestring = basestring except NameError: @@ -91,11 +77,6 @@ def name(self, value): if not (value is None or isinstance(value, basestring)): raise TypeError('name must be of type string.') - # Escape common CSV delimiters as workaround for - # https://github.com/sendgrid/sendgrid-python/issues/578 - if value is not None and (',' in value or ';' in value): - value = html_entity_decode(value) - value = '"' + value + '"' self._name = value @property diff --git a/test/test_email.py b/test/test_email.py index eb50374aa..9db060705 100644 --- a/test/test_email.py +++ b/test/test_email.py @@ -66,17 +66,3 @@ def test_empty_obj_add_email(self): email.email = address self.assertEqual(email.email, address) - - def test_add_name_with_comma(self): - email = Email() - name = "Name, Some" - email.name = name - - self.assertEqual(email.name, '"' + name + '"') - - def test_add_unicode_name_with_comma(self): - email = Email() - name = u"Name, Some" - email.name = name - - self.assertEqual(email.name, u'"' + name + u'"') From be104f1ff1c2b6220cfa1b3ef7375c1b4d0fa118 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 14 Jun 2021 22:29:00 -0700 Subject: [PATCH 130/237] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb2a49911..a4c7241db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,4 +39,4 @@ notifications: on_success: never on_failure: change rooms: - secure: n7ZtDd7AvPsw7Wd6fOCCWYiakWpCnYs1QqXpiozF9Rh1Z90XcrQp72utPFyl81jJp7zlgYWXSfHqmnUpbOCWd04WTsC4dkAY6dd/ThARV4kRkxONX3nlbRESOeZIWNXNOeSR1pg6sd9H7xwIDGmmN2arnFRNiQAD0y5li0yxAfQ= + secure: p48e21acIxzCs/vFcrSGvcv3jk/PnLcI8BaFpek7KE6lFUi+lDOlg3tNJlqBwQh2BKuoFdd4+x5uNcfpm3cl32usPA2K4e5EX6su+yJcrtt18kAt+p9AjrqFqxgKiq3gKCF/Bh8+r+yk8wMgS+WU8Bg2z6cwUqAoy5OcFwkvYu0wbDkFtEwWljXZbWejfEGD5OEq/4aZzM0GNl3DRdVcU7l4p0A3xPLIUJDSjKQ4J3GZSZE64YqHH1ANJergcX6mmMGVIQEHzgAXXBcLanzxTQfySgrrVMJz/xZh4lRJ/EMxMDj9LXFjOgQxJfo5qgPfhgc+s1hFajS0ykcJZW0Y7DnJz42Bjw4HnQayxEoB4/2HBD2Osggkd6mshe86QNzi1Xjd/V+Bs/RfuFHiU63AuAn0F1VHuOyrFu55MDCaJTg5RoWigP3k8cIlIMPAYygdxwB++FwcMiEdnoV9Coh4Lx6d6UNctGUOM22Dlnchn0CXbIb6/jqJA0atM9RvP3O0tcgD1xcN6IfiF55QAkd3E3K1aC+9pvy8UnD6biLf3k6YvaVrO/9ds+KbAhvQhnTnmhc++yAOdb24pbFQQVUYbn6/9nUkFs0Qw5yNP4Smp8dLOL/m9iwSwIqfclVY8GgYzjdDvib7NwWuB2IaHvbNPCsNx7PRtT81RNASoxc/+aM= From 33598f74b64c8da91867bdf5f2b9bf1a74057de8 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 16 Jun 2021 20:55:24 +0000 Subject: [PATCH 131/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 648cecfeb..90674eee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-06-16] Version 6.7.1 +-------------------------- +**Library - Chore** +- [PR #994](https://github.com/sendgrid/sendgrid-python/pull/994): remove logic adding quotes to names containing , and ;. Thanks to [@JenniferMah](https://github.com/JenniferMah)! + + [2021-04-21] Version 6.7.0 -------------------------- **Library - Docs** From 8d9d1f0df0072755a8bb4a71b67c70a3bc6fd072 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 16 Jun 2021 21:05:58 +0000 Subject: [PATCH 132/237] Release 6.7.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index bc09034be..157048dac 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.7.0' +__version__ = '6.7.1' From 44dbf5c27da9f47291b5a1fa656b711cce418f53 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Wed, 16 Jun 2021 16:27:21 -0700 Subject: [PATCH 133/237] update slack token --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a4c7241db..35f9fdc2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,4 +39,4 @@ notifications: on_success: never on_failure: change rooms: - secure: p48e21acIxzCs/vFcrSGvcv3jk/PnLcI8BaFpek7KE6lFUi+lDOlg3tNJlqBwQh2BKuoFdd4+x5uNcfpm3cl32usPA2K4e5EX6su+yJcrtt18kAt+p9AjrqFqxgKiq3gKCF/Bh8+r+yk8wMgS+WU8Bg2z6cwUqAoy5OcFwkvYu0wbDkFtEwWljXZbWejfEGD5OEq/4aZzM0GNl3DRdVcU7l4p0A3xPLIUJDSjKQ4J3GZSZE64YqHH1ANJergcX6mmMGVIQEHzgAXXBcLanzxTQfySgrrVMJz/xZh4lRJ/EMxMDj9LXFjOgQxJfo5qgPfhgc+s1hFajS0ykcJZW0Y7DnJz42Bjw4HnQayxEoB4/2HBD2Osggkd6mshe86QNzi1Xjd/V+Bs/RfuFHiU63AuAn0F1VHuOyrFu55MDCaJTg5RoWigP3k8cIlIMPAYygdxwB++FwcMiEdnoV9Coh4Lx6d6UNctGUOM22Dlnchn0CXbIb6/jqJA0atM9RvP3O0tcgD1xcN6IfiF55QAkd3E3K1aC+9pvy8UnD6biLf3k6YvaVrO/9ds+KbAhvQhnTnmhc++yAOdb24pbFQQVUYbn6/9nUkFs0Qw5yNP4Smp8dLOL/m9iwSwIqfclVY8GgYzjdDvib7NwWuB2IaHvbNPCsNx7PRtT81RNASoxc/+aM= + secure: CTG+XvHwzZlUuc8Gdq96+sK9w1FbkRCBg0yiDGtXFVK8fWFPQEwxLBWQ+yL7vzkS1RMc+Ib7ML4tKU2CMlVxgATOT7RetOioFw56RyV/fd+9eon1PONuz+d5HTIHm64GMhKSxvC4TQbUA4m4+kRX8bCsCfUpTz90HpTm5nSXZ/o= From 5eb3aaef6e96cd0469f3f1ffc334a42e67c3bf8e Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 16 Jun 2021 16:39:31 -0700 Subject: [PATCH 134/237] chore: add docker credentials to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a4c7241db..a9a470a26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_script: - chmod +x ./cc-test-reporter - "./cc-test-reporter before-build" script: +- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - make test-docker after_script: - make test-install From 5a31c75568a574b984e0f8aa76a5e8700d23ab0e Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Wed, 16 Jun 2021 16:44:30 -0700 Subject: [PATCH 135/237] update slack token --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d55a26d7..02c163356 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,4 +40,4 @@ notifications: on_success: never on_failure: change rooms: - secure: CTG+XvHwzZlUuc8Gdq96+sK9w1FbkRCBg0yiDGtXFVK8fWFPQEwxLBWQ+yL7vzkS1RMc+Ib7ML4tKU2CMlVxgATOT7RetOioFw56RyV/fd+9eon1PONuz+d5HTIHm64GMhKSxvC4TQbUA4m4+kRX8bCsCfUpTz90HpTm5nSXZ/o= + secure: B0SJHc9Syyf5HOl21abg/Uj/Gp7EusCOly/2JZzUUHCWtxC8C9pWfGf2e674R4vdeJ3FmTKz/1jJZ96vzV0z+XUpT2Fnn6URi4kjI8C0XNTs8la+bz5riSM4TokYOv0HGbL/r0OmHraodCxuX1rpkcYX+FD1dwcGC70eEB6NIu4= From c905e05a80fea6cd06189522d3f760cffd6c769d Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Wed, 21 Jul 2021 15:27:34 -0700 Subject: [PATCH 136/237] Remove newsletter badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index de23ef2f6..8b089aeb3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Travis Badge](https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-python) [![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) -[![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors) From 25c3de49aea06a02b66ab2645583f52bc3c2881a Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Thu, 29 Jul 2021 14:29:36 -0700 Subject: [PATCH 137/237] chore: remove docker credentials for PRs --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 02c163356..2341f8631 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,9 @@ before_script: - chmod +x ./cc-test-reporter - "./cc-test-reporter before-build" script: -- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +- if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin + fi - make test-docker after_script: - make test-install From c99e8ea481bdc2c036f8fe9971c732ef3cb598a2 Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Thu, 29 Jul 2021 14:33:09 -0700 Subject: [PATCH 138/237] chore: revert removal of docker credentials for PRs --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2341f8631..02c163356 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,7 @@ before_script: - chmod +x ./cc-test-reporter - "./cc-test-reporter before-build" script: -- if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin - fi +- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - make test-docker after_script: - make test-install From 4047acd5e131b3942308f7c09fb5577b9bf6aa15 Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Thu, 29 Jul 2021 14:46:56 -0700 Subject: [PATCH 139/237] chore: remove docker credentials for PRs --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 02c163356..76606df83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,9 @@ before_script: - chmod +x ./cc-test-reporter - "./cc-test-reporter before-build" script: -- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +- if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin; + fi - make test-docker after_script: - make test-install From 272274ae26943bf0d7433843dab914ab9fcb4993 Mon Sep 17 00:00:00 2001 From: vindarel Date: Fri, 30 Jul 2021 17:11:45 +0200 Subject: [PATCH 140/237] feat: add reply_to to helpers.Mail (#999) * Add reply_to to helpers.Mail Otherwise, we must create the Mail and then set the reply_to thanks to its setter. (and we have to dig the code to find out). * fix: tests: add missing import Co-authored-by: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> --- sendgrid/helpers/mail/mail.py | 7 +++++++ test/test_mail_helpers.py | 7 ++++++- use_cases/send_a_single_email_to_a_single_recipient.md | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index ba21f7891..ba04a2b5b 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -24,6 +24,7 @@ def __init__( self, from_email=None, to_emails=None, + reply_to=None, subject=None, plain_text_content=None, html_content=None, @@ -40,6 +41,8 @@ def __init__( :param to_emails: The email address of the recipient :type to_emails: To, str, tuple, list(str), list(tuple), list(To), optional + :param reply_to: The email address to reply to + :type reply_to: ReplyTo, tuple, optional :param plain_text_content: The plain text body of the email :type plain_text_content: string, optional :param html_content: The html body of the email @@ -79,6 +82,10 @@ def __init__( if html_content is not None: self.add_content(html_content, MimeType.html) + # Optional + if reply_to is not None: + self.reply_to = reply_to + def __str__(self): """A JSON-ready string representation of this Mail object. diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index 57a4ba880..49c58d05b 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -94,12 +94,13 @@ def test_batch_id(self): # Send a Single Email to a Single Recipient def test_single_email_to_a_single_recipient(self): - from sendgrid.helpers.mail import (Mail, From, To, Subject, + from sendgrid.helpers.mail import (Mail, From, To, ReplyTo, Subject, PlainTextContent, HtmlContent) self.maxDiff = None message = Mail( from_email=From('test+from@example.com', 'Example From Name'), to_emails=To('test+to@example.com', 'Example To Name'), + reply_to=ReplyTo('test+reply_to@example.com', 'Example Reply To Name'), subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent( 'and easy to do anywhere, even with Python'), @@ -123,6 +124,10 @@ def test_single_email_to_a_single_recipient(self): "email": "test+from@example.com", "name": "Example From Name" }, + "reply_to": { + "email": "test+reply_to@example.com", + "name": "Example Reply To Name" + }, "personalizations": [ { "to": [ diff --git a/use_cases/send_a_single_email_to_a_single_recipient.md b/use_cases/send_a_single_email_to_a_single_recipient.md index 8a2364285..c469c3bd6 100644 --- a/use_cases/send_a_single_email_to_a_single_recipient.md +++ b/use_cases/send_a_single_email_to_a_single_recipient.md @@ -6,6 +6,7 @@ from sendgrid.helpers.mail import Mail message = Mail( from_email='from_email@example.com', to_emails='to@example.com', + reply_to='reply_to@example.com', subject='Sending with Twilio SendGrid is Fun', html_content='and easy to do anywhere, even with Python') try: From c0da90440f25c82648b0fda0d9e62f02ec8a55e8 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 11 Aug 2021 16:45:38 +0000 Subject: [PATCH 141/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90674eee0..ad87a42d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-08-11] Version 6.8.0 +-------------------------- +**Library - Feature** +- [PR #999](https://github.com/sendgrid/sendgrid-python/pull/999): add reply_to to helpers.Mail. Thanks to [@vindarel](https://github.com/vindarel)! + + [2021-06-16] Version 6.7.1 -------------------------- **Library - Chore** From 08f0670aa2a5d05cfe981e3584dcd491d469b26d Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 11 Aug 2021 16:52:36 +0000 Subject: [PATCH 142/237] Release 6.8.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 157048dac..ff52e2e6c 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.7.1' +__version__ = '6.8.0' From 62d43ed0b27c8f7eec6dad8fe3880b81be7b1d2c Mon Sep 17 00:00:00 2001 From: Shwetha Radhakrishna Date: Wed, 18 Aug 2021 12:57:37 -0500 Subject: [PATCH 143/237] chore: revert reply_to prop add in mail (#1003) Co-authored-by: Shwetha Radhakrishna --- sendgrid/helpers/mail/mail.py | 7 ------- test/test_mail_helpers.py | 9 ++------- use_cases/send_a_single_email_to_a_single_recipient.md | 1 - 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index ba04a2b5b..ba21f7891 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -24,7 +24,6 @@ def __init__( self, from_email=None, to_emails=None, - reply_to=None, subject=None, plain_text_content=None, html_content=None, @@ -41,8 +40,6 @@ def __init__( :param to_emails: The email address of the recipient :type to_emails: To, str, tuple, list(str), list(tuple), list(To), optional - :param reply_to: The email address to reply to - :type reply_to: ReplyTo, tuple, optional :param plain_text_content: The plain text body of the email :type plain_text_content: string, optional :param html_content: The html body of the email @@ -82,10 +79,6 @@ def __init__( if html_content is not None: self.add_content(html_content, MimeType.html) - # Optional - if reply_to is not None: - self.reply_to = reply_to - def __str__(self): """A JSON-ready string representation of this Mail object. diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index 49c58d05b..1598c607b 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -94,13 +94,12 @@ def test_batch_id(self): # Send a Single Email to a Single Recipient def test_single_email_to_a_single_recipient(self): - from sendgrid.helpers.mail import (Mail, From, To, ReplyTo, Subject, + from sendgrid.helpers.mail import (Mail, From, To, Subject, PlainTextContent, HtmlContent) self.maxDiff = None message = Mail( from_email=From('test+from@example.com', 'Example From Name'), to_emails=To('test+to@example.com', 'Example To Name'), - reply_to=ReplyTo('test+reply_to@example.com', 'Example Reply To Name'), subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent( 'and easy to do anywhere, even with Python'), @@ -124,10 +123,6 @@ def test_single_email_to_a_single_recipient(self): "email": "test+from@example.com", "name": "Example From Name" }, - "reply_to": { - "email": "test+reply_to@example.com", - "name": "Example Reply To Name" - }, "personalizations": [ { "to": [ @@ -660,7 +655,7 @@ def test_personalization_add_email_filters_out_duplicate_to_emails(self): p.add_email(to_email) self.assertEqual([to_email.get()], p.tos) - + def test_personalization_add_email_filters_out_duplicate_to_emails_ignoring_case(self): self.maxDiff = None diff --git a/use_cases/send_a_single_email_to_a_single_recipient.md b/use_cases/send_a_single_email_to_a_single_recipient.md index c469c3bd6..8a2364285 100644 --- a/use_cases/send_a_single_email_to_a_single_recipient.md +++ b/use_cases/send_a_single_email_to_a_single_recipient.md @@ -6,7 +6,6 @@ from sendgrid.helpers.mail import Mail message = Mail( from_email='from_email@example.com', to_emails='to@example.com', - reply_to='reply_to@example.com', subject='Sending with Twilio SendGrid is Fun', html_content='and easy to do anywhere, even with Python') try: From 395f86d2feb04a00d510b4107e543edaf0506d80 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 25 Aug 2021 18:43:36 +0000 Subject: [PATCH 144/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad87a42d9..7ae148d6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-08-25] Version 6.8.1 +-------------------------- +**Library - Chore** +- [PR #1003](https://github.com/sendgrid/sendgrid-python/pull/1003): get rid of reply_to in mail helper. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! + + [2021-08-11] Version 6.8.0 -------------------------- **Library - Feature** From e40816321149fa360de297eab49979c3e522c825 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 25 Aug 2021 18:48:28 +0000 Subject: [PATCH 145/237] Release 6.8.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index ff52e2e6c..c5a38a4f5 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.8.0' +__version__ = '6.8.1' From a9a80675937ff3b9d8d9719e95a0b87cb42929ae Mon Sep 17 00:00:00 2001 From: Shwetha Radhakrishna Date: Fri, 10 Sep 2021 12:05:00 -0500 Subject: [PATCH 146/237] chore: add tests for v3.9 (#1007) --- .travis.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 76606df83..46f3601b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ env: - version=3.6 - version=3.7 - version=3.8 + - version=3.9 global: - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN before_script: diff --git a/README.md b/README.md index 8b089aeb3..8ce206abb 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ We appreciate your continued support, thank you! ## Prerequisites -- Python version 2.7, 3.5, 3.6, 3.7, or 3.8 +- Python version 2.7+ - The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-python) ## Setup Environment Variables From 14a07cd85a51d4c26d9fe828bb829dca5e2ad401 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 22 Sep 2021 21:05:13 +0000 Subject: [PATCH 147/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae148d6d..f4712dc13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-09-22] Version 6.8.2 +-------------------------- +**Library - Chore** +- [PR #1007](https://github.com/sendgrid/sendgrid-python/pull/1007): test against v3.9. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! + + [2021-08-25] Version 6.8.1 -------------------------- **Library - Chore** From c22b7f6ca97a750ac68042d706ffd34af6fde429 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 22 Sep 2021 21:13:09 +0000 Subject: [PATCH 148/237] Release 6.8.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index c5a38a4f5..94859745c 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.8.1' +__version__ = '6.8.2' From 0d00f0dfe98a8c442c66f891f6fca18234418606 Mon Sep 17 00:00:00 2001 From: Shwetha Radhakrishna Date: Fri, 8 Oct 2021 06:51:53 -0700 Subject: [PATCH 149/237] docs: improve signed event webhook validation docs (#1013) --- TROUBLESHOOTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index b9a68b8c0..0a7f54c69 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -15,6 +15,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se * [Version Convention](#versions) * [Viewing the Request Body](#request-body) * [Error Handling](#error-handling) +* [Verifying Event Webhooks](#signed-webhooks) ## Environment Variables and Your Twilio SendGrid API Key @@ -117,3 +118,14 @@ You can do this right before you call `response = sg.client.mail.send.post(reque # Error Handling Please review [our use_cases](use_cases/README.md) for examples of error handling. + + +## Signed Webhook Verification + +Twilio SendGrid's Event Webhook will notify a URL via HTTP POST with information about events that occur as your mail is processed. [This](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features) article covers all you need to know to secure the Event Webhook, allowing you to verify that incoming requests originate from Twilio SendGrid. The sendgrid-python library can help you verify these Signed Event Webhooks. + +You can find the usage example [here](examples/helpers/eventwebhook/eventwebhook_example.py) and the tests [here](test/test_eventwebhook.py). +If you are still having trouble getting the validation to work, follow the following instructions: +- Be sure to use the *raw* payload for validation +- Be sure to include a trailing carriage return and newline in your payload +- In case of multi-event webhooks, make sure you include the trailing newline and carriage return after *each* event From 77ae5f5c7ae69a49d9814d96ccc418a31c3271cd Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Mon, 11 Oct 2021 11:31:14 -0700 Subject: [PATCH 150/237] chore: pin starkbank-ecdsa version (#1015) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ff1ba3c35..37e68e9d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ PyYAML>=4.2b1 python-http-client>=3.2.1 six==1.11.0 pytest==3.8.2 -starkbank-ecdsa>=1.0.0 +starkbank-ecdsa>=1.0.0,<2.0.0 From 01b72926140af023bfa2546d09dbb3b9be126a90 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Mon, 11 Oct 2021 13:41:24 -0700 Subject: [PATCH 151/237] chore: pin starkbank-ecdsa version (#1016) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b3eeec82d..8ec7329c8 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def getRequires(): deps = [ 'python_http_client>=3.2.1', - 'starkbank-ecdsa>=1.0.0' + 'starkbank-ecdsa>=1.0.0,<2.0.0' ] return deps From 3fdf07930123f494088ab276441d538ac11ef9fa Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 18 Oct 2021 18:31:15 +0000 Subject: [PATCH 152/237] [Librarian] Version Bump --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4712dc13..53d21c256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-10-18] Version 6.8.3 +-------------------------- +**Library - Chore** +- [PR #1016](https://github.com/sendgrid/sendgrid-python/pull/1016): pin starkbank-ecdsa version. Thanks to [@eshanholtz](https://github.com/eshanholtz)! +- [PR #1015](https://github.com/sendgrid/sendgrid-python/pull/1015): pin starkbank-ecdsa version. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + +**Library - Docs** +- [PR #1013](https://github.com/sendgrid/sendgrid-python/pull/1013): improve signed event webhook validation docs. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! + + [2021-09-22] Version 6.8.2 -------------------------- **Library - Chore** From 2e12f1cc86f7fc59d1fd0cea0030d0213aee493f Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 18 Oct 2021 18:35:05 +0000 Subject: [PATCH 153/237] Release 6.8.3 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 94859745c..b45da21b6 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.8.2' +__version__ = '6.8.3' From a97e83a15dffe41cd87f52316fe04502314aec39 Mon Sep 17 00:00:00 2001 From: Bilal Boussayoud Date: Mon, 25 Oct 2021 15:07:33 -0600 Subject: [PATCH 154/237] feat: allow personalization of the From name and email for each recipient (#1020) * feat: allow personalization of the From name and email for each recipient --- examples/helpers/README.md | 12 ++-- examples/helpers/mail_example.py | 65 ++++++++++++++++--- sendgrid/helpers/mail/personalization.py | 21 +++++- test/test_mail_helpers.py | 9 +++ use_cases/README.md | 1 + .../send_multiple_emails_personalizations.md | 32 +++++++++ 6 files changed, 126 insertions(+), 14 deletions(-) create mode 100644 use_cases/send_multiple_emails_personalizations.md diff --git a/examples/helpers/README.md b/examples/helpers/README.md index df1746b52..8d7594d44 100644 --- a/examples/helpers/README.md +++ b/examples/helpers/README.md @@ -28,12 +28,16 @@ For more information on parameters and usage, see [here](../mail/mail.py) ### Creating Personalizations -To create personalizations, you need a dictionary to store all your email components. See example [here](https://github.com/sendgrid/sendgrid-python/blob/0b683169b08d3a7c204107cd333be33053297e74/examples/helpers/mail_example.py#L47) -After creating a dictionary, you can go ahead and create a `Personalization` object. +The personalization helper can be used to create personalizations and customize various aspects of an email. See example [here](mail_example.py) in `build_multiple_emails_personalized()`, and refer [here](https://docs.sendgrid.com/for-developers/sending-email/personalizations) for more documentation. ``` mock_personalization = Personalization() - for to_addr in personalization['to_list']: - mock_personalization.add_to(to_addr) + + for to_addr in personalization['to_list']: + mock_personalization.add_to(to_addr) + + mock_personalization.set_from(from_addr) + mock_personalization.add_cc(cc_addr) + # etc... ``` ### Creating Attachments diff --git a/examples/helpers/mail_example.py b/examples/helpers/mail_example.py index 700970110..384181501 100644 --- a/examples/helpers/mail_example.py +++ b/examples/helpers/mail_example.py @@ -13,7 +13,7 @@ def build_hello_email(): from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, From, To, Subject, PlainTextContent, HtmlContent, SendGridException - message = Mail(from_email=From('from@example.com.com', 'Example From Name'), + message = Mail(from_email=From('from@example.com', 'Example From Name'), to_emails=To('to@example.com', 'Example To Name'), subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), @@ -26,25 +26,30 @@ def build_hello_email(): except SendGridException as e: print(e.message) - for cc_addr in personalization['cc_list']: + mock_personalization = Personalization() + personalization_dict = get_mock_personalization_dict() + + for cc_addr in personalization_dict['cc_list']: mock_personalization.add_to(cc_addr) - for bcc_addr in personalization['bcc_list']: + for bcc_addr in personalization_dict['bcc_list']: mock_personalization.add_bcc(bcc_addr) - for header in personalization['headers']: + for header in personalization_dict['headers']: mock_personalization.add_header(header) - for substitution in personalization['substitutions']: + for substitution in personalization_dict['substitutions']: mock_personalization.add_substitution(substitution) - for arg in personalization['custom_args']: + for arg in personalization_dict['custom_args']: mock_personalization.add_custom_arg(arg) - mock_personalization.subject = personalization['subject'] - mock_personalization.send_at = personalization['send_at'] - return mock_personalization + mock_personalization.subject = personalization_dict['subject'] + mock_personalization.send_at = personalization_dict['send_at'] + + message.add_personalization(mock_personalization) + return message def get_mock_personalization_dict(): """Get a dict of personalization mock.""" @@ -78,6 +83,36 @@ def get_mock_personalization_dict(): mock_pers['send_at'] = 1443636843 return mock_pers +def build_multiple_emails_personalized(): + import json + from sendgrid.helpers.mail import Mail, From, To, Cc, Bcc, Subject, PlainTextContent, \ + HtmlContent, SendGridException, Personalization + + # Note that the domain for all From email addresses must match + message = Mail(from_email=From('from@example.com', 'Example From Name'), + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), + html_content=HtmlContent('and easy to do anywhere, even with Python')) + + mock_personalization = Personalization() + mock_personalization.add_to(To('test@example.com', 'Example User 1')) + mock_personalization.add_cc(Cc('test1@example.com', 'Example User 2')) + message.add_personalization(mock_personalization) + + mock_personalization_2 = Personalization() + mock_personalization_2.add_to(To('test2@example.com', 'Example User 3')) + mock_personalization_2.set_from(From('from@example.com', 'Example From Name 2')) + mock_personalization_2.add_bcc(Bcc('test3@example.com', 'Example User 4')) + message.add_personalization(mock_personalization_2) + + try: + print(json.dumps(message.get(), sort_keys=True, indent=4)) + return message.get() + + except SendGridException as e: + print(e.message) + + return message def build_attachment1(): """Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content. @@ -308,6 +343,15 @@ def build_kitchen_sink(): return message +def send_multiple_emails_personalized(): + # Assumes you set your environment variable: + # https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md#environment-variables-and-your-sendgrid-api-key + message = build_multiple_emails_personalized() + sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) + response = sendgrid_client.send(message=message) + print(response.status_code) + print(response.body) + print(response.headers) def send_hello_email(): # Assumes you set your environment variable: @@ -334,5 +378,8 @@ def send_kitchen_sink(): ## this will actually send an email # send_hello_email() +## this will send multiple emails +# send_multiple_emails_personalized() + ## this will only send an email if you set SandBox Mode to False # send_kitchen_sink() diff --git a/sendgrid/helpers/mail/personalization.py b/sendgrid/helpers/mail/personalization.py index 21a31c863..a4e1c1de4 100644 --- a/sendgrid/helpers/mail/personalization.py +++ b/sendgrid/helpers/mail/personalization.py @@ -6,6 +6,7 @@ class Personalization(object): def __init__(self): """Create an empty Personalization and initialize member variables.""" self._tos = [] + self._from_email = None self._ccs = [] self._bccs = [] self._subject = None @@ -26,7 +27,10 @@ def add_email(self, email): if email_type.__name__ == 'Bcc': self.add_bcc(email) return - raise ValueError('Please use a To, Cc or Bcc object.') + if email_type.__name__ == 'From': + self.from_email = email + return + raise ValueError('Please use a To, From, Cc or Bcc object.') def _get_unique_recipients(self, recipients): unique_recipients = [] @@ -77,6 +81,17 @@ def add_to(self, email): self._tos.append(email.get()) + @property + def from_email(self): + return self._from_email + + @from_email.setter + def from_email(self, value): + self._from_email = value + + def set_from(self, email): + self._from_email = email.get() + @property def ccs(self): """A list of recipients who will receive copies of this email. @@ -236,6 +251,10 @@ def get(self): if value: personalization[key[:-1]] = value + from_value = getattr(self, 'from_email') + if from_value: + personalization['from'] = from_value + for key in ['subject', 'send_at', 'dynamic_template_data']: value = getattr(self, key) if value: diff --git a/test/test_mail_helpers.py b/test/test_mail_helpers.py index 1598c607b..a7d08d890 100644 --- a/test/test_mail_helpers.py +++ b/test/test_mail_helpers.py @@ -667,6 +667,15 @@ def test_personalization_add_email_filters_out_duplicate_to_emails_ignoring_case self.assertEqual([to_email.get()], p.tos) + def test_personalization_set_from_email(self): + self.maxDiff = None + + p = Personalization() + from_email = From('test+from@example.com', 'Example From') + p.set_from(from_email) + + self.assertEqual(from_email.get(), p.from_email) + def test_personalization_filters_out_duplicate_cc_emails(self): self.maxDiff = None diff --git a/use_cases/README.md b/use_cases/README.md index a91f1f5a4..f9fe2470e 100644 --- a/use_cases/README.md +++ b/use_cases/README.md @@ -8,6 +8,7 @@ This directory provides examples for specific use cases of this library. Please * [Send a Single Email to a Single Recipient](send_a_single_email_to_a_single_recipient.md) * [Send a Single Email to Multiple Recipients](send_a_single_email_to_multiple_recipients.md) * [Send Multiple Emails to Multiple Recipients](send_multiple_emails_to_multiple_recipients.md) +* [Send Multiple Emails with Personalizations](send_multiple_emails_personalizations.md) * [Kitchen Sink - an example with all settings used](kitchen_sink.md) * [Transactional Templates](transactional_templates.md) * [Attachments](attachment.md) diff --git a/use_cases/send_multiple_emails_personalizations.md b/use_cases/send_multiple_emails_personalizations.md new file mode 100644 index 000000000..e8a7e2eec --- /dev/null +++ b/use_cases/send_multiple_emails_personalizations.md @@ -0,0 +1,32 @@ +```python +import os +import json +from sendgrid import SendGridAPIClient +from sendgrid.helpers.mail import Mail, Personalization, From, To, Cc, Bcc + +# Note that the domain for all From email addresses must match +message = Mail( + from_email=('from@example.com', 'Example From Name'), + subject='Sending with Twilio SendGrid is Fun', + html_content='and easy to do anywhere, even with Python') + +personalization1 = Personalization() +personalization1.add_email(To('test0@example.com', 'Example Name 0')) +personalization1.add_email(Cc('test1@example.com', 'Example Name 1')) +message.add_personalization(personalization1) + +personalization2 = Personalization() +personalization2.add_email(To('test2@example.com', 'Example Name 2')) +personalization2.add_email(Bcc('test3@example.com', 'Example Name 3')) +personalization2.add_email(From('from2@example.com', 'Example From Name 2')) +message.add_personalization(personalization2) + +try: + sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) + response = sendgrid_client.send(message) + print(response.status_code) + print(response.body) + print(response.headers) +except Exception as e: + print(e.message) +``` \ No newline at end of file From 5e9b0ff061a3cb888f7089473b7039432b748f37 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 3 Nov 2021 18:51:55 +0000 Subject: [PATCH 155/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53d21c256..8004be4db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-11-03] Version 6.9.0 +-------------------------- +**Library - Feature** +- [PR #1020](https://github.com/sendgrid/sendgrid-python/pull/1020): allow personalization of the From name and email for each recipient. Thanks to [@beebzz](https://github.com/beebzz)! + + [2021-10-18] Version 6.8.3 -------------------------- **Library - Chore** From ab040cb25696a900224789cb2f97bbf5193fd307 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 3 Nov 2021 18:55:47 +0000 Subject: [PATCH 156/237] Release 6.9.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index b45da21b6..a51875d3a 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.8.3' +__version__ = '6.9.0' From e27a2b1b7c1102710f10fe6674e6b93c64431666 Mon Sep 17 00:00:00 2001 From: hellno Date: Tue, 9 Nov 2021 23:59:21 +0100 Subject: [PATCH 157/237] chore: fix vulnerability in starbank-ecdsa dependency (#1022) Co-authored-by: Jennifer Mah --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 37e68e9d9..04c3b87e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ PyYAML>=4.2b1 python-http-client>=3.2.1 six==1.11.0 pytest==3.8.2 -starkbank-ecdsa>=1.0.0,<2.0.0 +starkbank-ecdsa>=2.0.1 diff --git a/setup.py b/setup.py index 8ec7329c8..365ebb50b 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def getRequires(): deps = [ 'python_http_client>=3.2.1', - 'starkbank-ecdsa>=1.0.0,<2.0.0' + 'starkbank-ecdsa>=2.0.1' ] return deps From 05557b665dd6edfa41e1290c36dfa9fd76be2762 Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Tue, 9 Nov 2021 16:32:32 -0800 Subject: [PATCH 158/237] fix: fix event webhook for updated starbank-ecdsa dependency --- sendgrid/helpers/eventwebhook/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py index a44eb5b89..c1ec7d1c8 100644 --- a/sendgrid/helpers/eventwebhook/__init__.py +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -27,7 +27,7 @@ def convert_public_key_to_ecdsa(self, public_key): :return: public key using the ECDSA algorithm :rtype PublicKey """ - return PublicKey.fromPem(public_key) + return PublicKey.fromPem('\n-----BEGIN PUBLIC KEY-----\n'+public_key+'\n-----END PUBLIC KEY-----\n') def verify_signature(self, payload, signature, timestamp, public_key=None): """ From a3cbe32bd270db4fc2d81b92f73baf6ddab113a7 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Tue, 9 Nov 2021 17:25:30 -0800 Subject: [PATCH 159/237] Chore: pin more-itertools version --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 04c3b87e8..b2ba4d1be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ python-http-client>=3.2.1 six==1.11.0 pytest==3.8.2 starkbank-ecdsa>=2.0.1 +more-itertools==5.0.0 From f5d6a3837d67d4ed479d4509c14822ad95730291 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:58:16 -0800 Subject: [PATCH 160/237] docs: fix event webhook documentation --- use_cases/email_stats.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use_cases/email_stats.md b/use_cases/email_stats.md index c40ccb882..10e265721 100644 --- a/use_cases/email_stats.md +++ b/use_cases/email_stats.md @@ -2,4 +2,4 @@ You can find documentation for how to view your email statistics via the UI [here](https://app.sendgrid.com/statistics) and via API [here](../USAGE.md#stats). -Alternatively, we can post events to a URL of your choice via our [Event Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/event.html) about events that occur as Twilio SendGrid processes your email. \ No newline at end of file +Alternatively, we can post events to a URL of your choice via our [Event Webhook](https://docs.sendgrid.com/for-developers/tracking-events/event) about events that occur as Twilio SendGrid processes your email. From 26009631c6490b2e38f6daf7febe3fe7182699f6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 17 Nov 2021 19:24:12 +0000 Subject: [PATCH 161/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8004be4db..35318143e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-11-17] Version 6.9.1 +-------------------------- +**Library - Chore** +- [PR #1022](https://github.com/sendgrid/sendgrid-python/pull/1022): fix vulnerability in starbank-ecdsa dependency. Thanks to [@hellno](https://github.com/hellno)! + + [2021-11-03] Version 6.9.0 -------------------------- **Library - Feature** From 1565945d8f9025946ac8a79821ab07444db68e41 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 17 Nov 2021 19:28:16 +0000 Subject: [PATCH 162/237] Release 6.9.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index a51875d3a..ae7f14541 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.0' +__version__ = '6.9.1' From 744ca8cf1d7c0ae8fe29c86f18ad89718c99b830 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Wed, 1 Dec 2021 10:36:41 -0800 Subject: [PATCH 163/237] chore: migrate to GitHub Actions (#1027) --- .codeclimate.yml | 3 --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 50 +++++++++++++++++++++++++++++++++++ .travis.yml | 46 -------------------------------- Makefile | 1 + README.md | 3 +-- README.rst | 6 ++--- requirements.txt | 2 +- test/test_project.py | 8 ------ test/test_sendgrid.py | 4 +-- 10 files changed, 106 insertions(+), 65 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index ef7e1cb56..000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,3 +0,0 @@ -plugins: - pep8: - enabled: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..46df6809d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Publish Python distributions +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout sendgrid-python + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.6' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + + notify-on-failure: + name: Slack notify on failure + if: ${{ failure() }} + needs: [ release ] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} + SLACK_TITLE: Release Failure + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..fe2015a6e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,50 @@ +name: Run Tests +on: + push: + branches: [ '*' ] + pull_request: + branches: [ main ] + schedule: + # Run automatically at 8AM PST Monday-Friday + - cron: '0 15 * * 1-5' + workflow_dispatch: + +jobs: + tests: + name: Run Tests + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ] + steps: + - name: Checkout sendgrid-python + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Build & Test + run: make test-docker test-install + + notify-on-failure: + name: Slack notify on failure + if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} + needs: [ tests ] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} + SLACK_TITLE: Build Failure + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 46f3601b3..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -dist: xenial -language: python -cache: pip -services: -- docker -env: - matrix: - - version=2.7 - - version=3.5 - - version=3.6 - - version=3.7 - - version=3.8 - - version=3.9 - global: - - CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN -before_script: -- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 - > ./cc-test-reporter -- chmod +x ./cc-test-reporter -- "./cc-test-reporter before-build" -script: -- if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin; - fi -- make test-docker -after_script: -- make test-install -- ". venv/bin/activate; codecov" -- "./cc-test-reporter after-build --exit-code $?" -deploy: - provider: pypi - user: __token__ - password: "$PYPI_TOKEN" - skip_cleanup: true - distributions: sdist bdist_wheel - on: - tags: true - condition: "$version = 3.6" -notifications: - slack: - if: branch = main - on_pull_requests: false - on_success: never - on_failure: change - rooms: - secure: B0SJHc9Syyf5HOl21abg/Uj/Gp7EusCOly/2JZzUUHCWtxC8C9pWfGf2e674R4vdeJ3FmTKz/1jJZ96vzV0z+XUpT2Fnn6URi4kjI8C0XNTs8la+bz5riSM4TokYOv0HGbL/r0OmHraodCxuX1rpkcYX+FD1dwcGC70eEB6NIu4= diff --git a/Makefile b/Makefile index 620a25993..bb22db4df 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ venv: clean @python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1); + pip install virtualenv virtualenv --python=python venv install: venv diff --git a/README.md b/README.md index 8ce206abb..e2208293d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ ![SendGrid Logo](twilio_sendgrid_logo.png) -[![Travis Badge](https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-python) -[![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python) +[![Tests](https://github.com/sendgrid/sendgrid-python/actions/workflows/tests.yml/badge.svg)](https://github.com/sendgrid/sendgrid-python/actions/workflows/tests.yml) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) diff --git a/README.rst b/README.rst index a7a076c22..59f693f0f 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ -|Travis Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| +|Tests Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python.** @@ -288,8 +288,8 @@ License .. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md .. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/HEAD/LICENSE -.. |Travis Badge| image:: https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main - :target: https://travis-ci.com/sendgrid/sendgrid-python +.. |Tests Badge| image:: https://github.com/sendgrid/sendgrid-python/actions/workflows/test.yml/badge.svg + :target: https://github.com/sendgrid/sendgrid-python/actions/workflows/test.yml .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/sendgrid.svg :target: https://pypi.org/project/sendgrid/ .. |PyPI Version| image:: https://img.shields.io/pypi/v/sendgrid.svg diff --git a/requirements.txt b/requirements.txt index b2ba4d1be..f4b4ba105 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Flask==1.0.2 +Flask==1.1.2 PyYAML>=4.2b1 python-http-client>=3.2.1 six==1.11.0 diff --git a/test/test_project.py b/test/test_project.py index e30049a3f..c78293dff 100644 --- a/test/test_project.py +++ b/test/test_project.py @@ -11,14 +11,6 @@ def test_env(self): def test_gitignore(self): self.assertTrue(os.path.isfile('./.gitignore')) - # ./.travis.yml - def test_travis(self): - self.assertTrue(os.path.isfile('./.travis.yml')) - - # ./.codeclimate.yml - def test_codeclimate(self): - self.assertTrue(os.path.isfile('./.codeclimate.yml')) - # ./CHANGELOG.md def test_changelog(self): self.assertTrue(os.path.isfile('./CHANGELOG.md')) diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py index f6177a7d5..0c63851eb 100644 --- a/test/test_sendgrid.py +++ b/test/test_sendgrid.py @@ -1649,14 +1649,14 @@ def test_suppression_invalid_emails__email__delete(self): def test_suppression_spam_report__email__get(self): email = "test_url_param" headers = {'X-Mock': 200} - response = self.sg.client.suppression.spam_report._( + response = self.sg.client.suppression.spam_reports._( email).get(request_headers=headers) self.assertEqual(response.status_code, 200) def test_suppression_spam_report__email__delete(self): email = "test_url_param" headers = {'X-Mock': 204} - response = self.sg.client.suppression.spam_report._( + response = self.sg.client.suppression.spam_reports._( email).delete(request_headers=headers) self.assertEqual(response.status_code, 204) From 807b08bb6dff27e84e454f19f31b2a15a9aa3c9e Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Wed, 1 Dec 2021 10:49:09 -0800 Subject: [PATCH 164/237] fix: add Python distribution to release GH action --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46df6809d..2c59e9075 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: run: | python -m pip install --upgrade pip pip install build + python setup.py sdist bdist_wheel - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From cec16a4c8941bd778a3c2a432e058d0b7df53dc4 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:21:17 -0800 Subject: [PATCH 165/237] chore: add wheel install for GH action release --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c59e9075..65ef25a39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: run: | python -m pip install --upgrade pip pip install build + pip install wheel python setup.py sdist bdist_wheel - name: Publish package to PyPI From e00c300aeb3d1031aca96463cab11b4f541c1642 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 1 Dec 2021 21:10:29 +0000 Subject: [PATCH 166/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35318143e..4f102be33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-12-01] Version 6.9.2 +-------------------------- +**Library - Chore** +- [PR #1027](https://github.com/sendgrid/sendgrid-python/pull/1027): migrate to GitHub Actions. Thanks to [@JenniferMah](https://github.com/JenniferMah)! + + [2021-11-17] Version 6.9.1 -------------------------- **Library - Chore** From ed0b3ff73dfcb3b8188199106b7730f7b1d69f16 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 1 Dec 2021 21:13:05 +0000 Subject: [PATCH 167/237] Release 6.9.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index ae7f14541..b8fc882cc 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.1' +__version__ = '6.9.2' From 1dcc378bb90ed0d043c9dcfd239eb4c0b5501a81 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Tue, 14 Dec 2021 09:02:41 -0600 Subject: [PATCH 168/237] test: split up unit and integ tests (#1029) --- Makefile | 3 ++- test/integ/__init__.py | 0 test/{ => integ}/test_sendgrid.py | 0 test/unit/__init__.py | 0 test/{ => unit}/test_app.py | 0 test/{ => unit}/test_config.py | 0 test/{ => unit}/test_email.py | 0 test/{ => unit}/test_eventwebhook.py | 0 test/{ => unit}/test_inbound_send.py | 0 test/{ => unit}/test_mail_helpers.py | 0 test/{ => unit}/test_parse.py | 0 test/{ => unit}/test_project.py | 0 test/{ => unit}/test_spam_check.py | 0 test/{ => unit}/test_stats.py | 0 test/{ => unit}/test_twilio_email.py | 0 test/{ => unit}/test_unassigned.py | 0 16 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 test/integ/__init__.py rename test/{ => integ}/test_sendgrid.py (100%) create mode 100644 test/unit/__init__.py rename test/{ => unit}/test_app.py (100%) rename test/{ => unit}/test_config.py (100%) rename test/{ => unit}/test_email.py (100%) rename test/{ => unit}/test_eventwebhook.py (100%) rename test/{ => unit}/test_inbound_send.py (100%) rename test/{ => unit}/test_mail_helpers.py (100%) rename test/{ => unit}/test_parse.py (100%) rename test/{ => unit}/test_project.py (100%) rename test/{ => unit}/test_spam_check.py (100%) rename test/{ => unit}/test_stats.py (100%) rename test/{ => unit}/test_twilio_email.py (100%) rename test/{ => unit}/test_unassigned.py (100%) diff --git a/Makefile b/Makefile index bb22db4df..fb61004ce 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,10 @@ test-install: install . venv/bin/activate; pip install -r test/requirements.txt test: test-install + . venv/bin/activate; coverage run -m unittest discover -s test/unit test-integ: test - . venv/bin/activate; coverage run -m unittest discover + . venv/bin/activate; coverage run -m unittest discover -s test/integ version ?= latest test-docker: diff --git a/test/integ/__init__.py b/test/integ/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/test/test_sendgrid.py b/test/integ/test_sendgrid.py similarity index 100% rename from test/test_sendgrid.py rename to test/integ/test_sendgrid.py diff --git a/test/unit/__init__.py b/test/unit/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/test/test_app.py b/test/unit/test_app.py similarity index 100% rename from test/test_app.py rename to test/unit/test_app.py diff --git a/test/test_config.py b/test/unit/test_config.py similarity index 100% rename from test/test_config.py rename to test/unit/test_config.py diff --git a/test/test_email.py b/test/unit/test_email.py similarity index 100% rename from test/test_email.py rename to test/unit/test_email.py diff --git a/test/test_eventwebhook.py b/test/unit/test_eventwebhook.py similarity index 100% rename from test/test_eventwebhook.py rename to test/unit/test_eventwebhook.py diff --git a/test/test_inbound_send.py b/test/unit/test_inbound_send.py similarity index 100% rename from test/test_inbound_send.py rename to test/unit/test_inbound_send.py diff --git a/test/test_mail_helpers.py b/test/unit/test_mail_helpers.py similarity index 100% rename from test/test_mail_helpers.py rename to test/unit/test_mail_helpers.py diff --git a/test/test_parse.py b/test/unit/test_parse.py similarity index 100% rename from test/test_parse.py rename to test/unit/test_parse.py diff --git a/test/test_project.py b/test/unit/test_project.py similarity index 100% rename from test/test_project.py rename to test/unit/test_project.py diff --git a/test/test_spam_check.py b/test/unit/test_spam_check.py similarity index 100% rename from test/test_spam_check.py rename to test/unit/test_spam_check.py diff --git a/test/test_stats.py b/test/unit/test_stats.py similarity index 100% rename from test/test_stats.py rename to test/unit/test_stats.py diff --git a/test/test_twilio_email.py b/test/unit/test_twilio_email.py similarity index 100% rename from test/test_twilio_email.py rename to test/unit/test_twilio_email.py diff --git a/test/test_unassigned.py b/test/unit/test_unassigned.py similarity index 100% rename from test/test_unassigned.py rename to test/unit/test_unassigned.py From 54fb4035865bee25dea8bbbcd7ea0d9a9fa43235 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 15 Dec 2021 19:39:08 +0000 Subject: [PATCH 169/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f102be33..d4f521a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2021-12-15] Version 6.9.3 +-------------------------- +**Library - Test** +- [PR #1029](https://github.com/sendgrid/sendgrid-python/pull/1029): split up unit and integ tests. Thanks to [@childish-sambino](https://github.com/childish-sambino)! + + [2021-12-01] Version 6.9.2 -------------------------- **Library - Chore** From 1c7493cbadaff93a9b1dd918c63b22e129719f17 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 15 Dec 2021 19:41:42 +0000 Subject: [PATCH 170/237] Release 6.9.3 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index b8fc882cc..9d3fb5211 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.2' +__version__ = '6.9.3' From 76c5f46c103533a1c0d8d857e62f3af915cd4a89 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:27:25 -0700 Subject: [PATCH 171/237] chore: update license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e5439a92d..5db04ff6d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2021, Twilio SendGrid, Inc. +Copyright (C) 2022, Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From b729f401dc9c15393cc0e3036a025deff3d711c6 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Wed, 5 Jan 2022 14:48:25 -0800 Subject: [PATCH 172/237] docs: remove leading spaces on error handling example (#1032) --- use_cases/error_handling.md | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/use_cases/error_handling.md b/use_cases/error_handling.md index 187703b60..d0bdf0945 100644 --- a/use_cases/error_handling.md +++ b/use_cases/error_handling.md @@ -6,24 +6,24 @@ Please see [here](https://github.com/sendgrid/python-http-client/blob/HEAD/pytho There are also email specific exceptions located [here](../sendgrid/helpers/mail/exceptions.py) ```python - import os - from sendgrid import SendGridAPIClient - from sendgrid.helpers.mail import (From, To, Subject, PlainTextContent, HtmlContent, Mail) - from python_http_client import exceptions +import os +from sendgrid import SendGridAPIClient +from sendgrid.helpers.mail import (From, To, Subject, PlainTextContent, HtmlContent, Mail) +from python_http_client import exceptions - sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) - from_email = From("help@twilio.com") - to_email = To("ethomas@twilio.com") - subject = Subject("Sending with Twilio SendGrid is Fun") - plain_text_content = PlainTextContent("and easy to do anywhere, even with Python") - html_content = HtmlContent("and easy to do anywhere, even with Python") - message = Mail(from_email, to_email, subject, plain_text_content, html_content) - try: - response = sendgrid_client.send(message) - print(response.status_code) - print(response.body) - print(response.headers) - except exceptions.BadRequestsError as e: - print(e.body) - exit() +sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) +from_email = From("help@twilio.com") +to_email = To("ethomas@twilio.com") +subject = Subject("Sending with Twilio SendGrid is Fun") +plain_text_content = PlainTextContent("and easy to do anywhere, even with Python") +html_content = HtmlContent("and easy to do anywhere, even with Python") +message = Mail(from_email, to_email, subject, plain_text_content, html_content) +try: + response = sendgrid_client.send(message) + print(response.status_code) + print(response.body) + print(response.headers) +except exceptions.BadRequestsError as e: + print(e.body) + exit() ``` From df13b78b0cdcb410b4516f6761c4d3138edd4b2d Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Sat, 8 Jan 2022 02:49:23 +0530 Subject: [PATCH 173/237] chore: Remove unused import from distutils (#1031) Co-authored-by: Jennifer Mah --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 365ebb50b..e1d6600d6 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ import io import os -from distutils.file_util import copy_file from setuptools import setup, find_packages From ba7135ea3c41785efc1f1177faa3b287a02f721c Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 12 Jan 2022 20:32:31 +0000 Subject: [PATCH 174/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4f521a85..817ee5611 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2022-01-12] Version 6.9.4 +-------------------------- +**Library - Chore** +- [PR #1031](https://github.com/sendgrid/sendgrid-python/pull/1031): Remove unused import from distutils. Thanks to [@tirkarthi](https://github.com/tirkarthi)! + +**Library - Docs** +- [PR #1032](https://github.com/sendgrid/sendgrid-python/pull/1032): remove leading spaces on error handling example. Thanks to [@thinkingserious](https://github.com/thinkingserious)! + + [2021-12-15] Version 6.9.3 -------------------------- **Library - Test** From dc78d9ebf635d8e5e9d20439d51c6d9f3965b204 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 12 Jan 2022 20:34:59 +0000 Subject: [PATCH 175/237] Release 6.9.4 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 9d3fb5211..55b51e8b2 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.3' +__version__ = '6.9.4' From d7f81db48bdeb6ff14b263604ce3d6036284a232 Mon Sep 17 00:00:00 2001 From: Jack Slingerland Date: Thu, 20 Jan 2022 20:04:47 -0500 Subject: [PATCH 176/237] docs: Removing unused json import (#1036) --- use_cases/transactional_templates.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/use_cases/transactional_templates.md b/use_cases/transactional_templates.md index 9ee4848c3..460fd65ee 100644 --- a/use_cases/transactional_templates.md +++ b/use_cases/transactional_templates.md @@ -28,7 +28,6 @@ I hope you are having a great day in {{ city }} :) ```python import os -import json from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail @@ -86,7 +85,6 @@ I hope you are having a great day in {{{ city }}} :) ```python import os -import json from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail From d742ada8e6aaee77ab2f4f731f7099372255948b Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 26 Jan 2022 19:23:42 +0000 Subject: [PATCH 177/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 817ee5611..5e7d5c0be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2022-01-26] Version 6.9.5 +-------------------------- +**Library - Docs** +- [PR #1036](https://github.com/sendgrid/sendgrid-python/pull/1036): Removing unused json import. Thanks to [@vital101](https://github.com/vital101)! + + [2022-01-12] Version 6.9.4 -------------------------- **Library - Chore** From 3b17a349cc45eeb796d038722cd4a33ed4dea3ed Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 26 Jan 2022 19:26:42 +0000 Subject: [PATCH 178/237] Release 6.9.5 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 55b51e8b2..5b3835adf 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.4' +__version__ = '6.9.5' From bbd1319d5719728de5908b0fc650a5083ed2dcac Mon Sep 17 00:00:00 2001 From: Hunga1 Date: Thu, 3 Feb 2022 13:26:45 -0700 Subject: [PATCH 179/237] chore: merge test and deploy workflows (#1039) --- .github/workflows/release.yml | 50 ------------------- .github/workflows/test-and-deploy.yml | 71 +++++++++++++++++++++++++++ .github/workflows/tests.yml | 50 ------------------- README.md | 2 +- 4 files changed, 72 insertions(+), 101 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test-and-deploy.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 65ef25a39..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Publish Python distributions -on: - push: - tags: - - '*' - workflow_dispatch: - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout sendgrid-python - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.6' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - pip install wheel - python setup.py sdist bdist_wheel - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} - - notify-on-failure: - name: Slack notify on failure - if: ${{ failure() }} - needs: [ release ] - runs-on: ubuntu-latest - steps: - - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_COLOR: 'danger' - SLACK_ICON_EMOJI: ':github:' - SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} - SLACK_TITLE: Release Failure - SLACK_USERNAME: GitHub Actions - SLACK_MSG_AUTHOR: twilio-dx - SLACK_FOOTER: Posted automatically using GitHub Actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - MSG_MINIMAL: true diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml new file mode 100644 index 000000000..de9233e0a --- /dev/null +++ b/.github/workflows/test-and-deploy.yml @@ -0,0 +1,71 @@ +name: Test and Deploy +on: + push: + branches: [ '*' ] + tags: [ '*' ] + pull_request: + branches: [ main ] + schedule: + # Run automatically at 8AM PST Monday-Friday + - cron: '0 15 * * 1-5' + workflow_dispatch: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ] + steps: + - name: Checkout sendgrid-python + uses: actions/checkout@v2 + + - name: Build & Test + run: make test-docker version=${{ matrix.python-version }} + + deploy: + name: Deploy + if: success() && github.ref_type == 'tag' + needs: [ test ] + runs-on: ubuntu-latest + steps: + - name: Checkout sendgrid-python + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.6' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + pip install wheel + python setup.py sdist bdist_wheel + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + + notify-on-failure: + name: Slack notify on failure + if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') + needs: [ test, deploy ] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: failure + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} + SLACK_TITLE: Action Failure - ${{ github.repository }} + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index fe2015a6e..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Run Tests -on: - push: - branches: [ '*' ] - pull_request: - branches: [ main ] - schedule: - # Run automatically at 8AM PST Monday-Friday - - cron: '0 15 * * 1-5' - workflow_dispatch: - -jobs: - tests: - name: Run Tests - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - matrix: - python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ] - steps: - - name: Checkout sendgrid-python - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Build & Test - run: make test-docker test-install - - notify-on-failure: - name: Slack notify on failure - if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} - needs: [ tests ] - runs-on: ubuntu-latest - steps: - - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_COLOR: 'danger' - SLACK_ICON_EMOJI: ':github:' - SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} - SLACK_TITLE: Build Failure - SLACK_USERNAME: GitHub Actions - SLACK_MSG_AUTHOR: twilio-dx - SLACK_FOOTER: Posted automatically using GitHub Actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - MSG_MINIMAL: true diff --git a/README.md b/README.md index e2208293d..a653e38f9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![SendGrid Logo](twilio_sendgrid_logo.png) -[![Tests](https://github.com/sendgrid/sendgrid-python/actions/workflows/tests.yml/badge.svg)](https://github.com/sendgrid/sendgrid-python/actions/workflows/tests.yml) +[![BuildStatus](https://github.com/sendgrid/sendgrid-python/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/sendgrid-python/actions/workflows/test-and-deploy.yml) [![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) From 0c7a723f0b7c19a5fb5535c2d006d87191f355f9 Mon Sep 17 00:00:00 2001 From: Shwetha Radhakrishna Date: Thu, 3 Feb 2022 16:59:38 -0600 Subject: [PATCH 180/237] chore: add gh release to workflow (#1041) --- .github/workflows/test-and-deploy.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index de9233e0a..f061a5096 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -46,6 +46,13 @@ jobs: pip install wheel python setup.py sdist bdist_wheel + - name: Create GitHub Release + uses: sendgrid/dx-automator/actions/release@main + with: + footer: '**[pypi](https://pypi.org/project/sendgrid/${version})**' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 412ca9914eec30866a44f1c01f008df3c0a95f28 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 7 Feb 2022 12:50:41 -0600 Subject: [PATCH 181/237] fix: only do a Docker Login if the secrets are available --- .github/workflows/test-and-deploy.yml | 65 +++++++++++++++------------ 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index f061a5096..7ce3240c7 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -18,46 +18,55 @@ jobs: strategy: matrix: python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ] + env: + DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }} steps: - name: Checkout sendgrid-python uses: actions/checkout@v2 + - name: Login to Docker Hub + if: env.DOCKER_LOGIN + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_AUTH_TOKEN }} + - name: Build & Test run: make test-docker version=${{ matrix.python-version }} deploy: - name: Deploy - if: success() && github.ref_type == 'tag' - needs: [ test ] - runs-on: ubuntu-latest - steps: - - name: Checkout sendgrid-python - uses: actions/checkout@v2 + name: Deploy + if: success() && github.ref_type == 'tag' + needs: [ test ] + runs-on: ubuntu-latest + steps: + - name: Checkout sendgrid-python + uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.6' + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.6' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - pip install wheel - python setup.py sdist bdist_wheel + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + pip install wheel + python setup.py sdist bdist_wheel - - name: Create GitHub Release - uses: sendgrid/dx-automator/actions/release@main - with: - footer: '**[pypi](https://pypi.org/project/sendgrid/${version})**' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create GitHub Release + uses: sendgrid/dx-automator/actions/release@main + with: + footer: '**[pypi](https://pypi.org/project/sendgrid/${version})**' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} notify-on-failure: name: Slack notify on failure From 807a2c97dcc9fc92764f97c73b6086ab2426c4f5 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Tue, 8 Feb 2022 09:14:53 -0600 Subject: [PATCH 182/237] chore: upgrade supported language versions (#1043) --- .github/workflows/test-and-deploy.yml | 4 ++-- setup.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 7ce3240c7..842277933 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ] + python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10' ] env: DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }} steps: @@ -46,7 +46,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.6' + python-version: '3.10' - name: Install dependencies run: | diff --git a/setup.py b/setup.py index e1d6600d6..7e84802f4 100644 --- a/setup.py +++ b/setup.py @@ -38,5 +38,8 @@ def getRequires(): 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ] ) From b85c8fed2ffeff2084d005c164bd13851f245db7 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 9 Feb 2022 10:56:42 -0600 Subject: [PATCH 183/237] chore: drop pytest which was not being used (#1044) --- requirements.txt | 1 - test/unit/test_unassigned.py | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index f4b4ba105..0c34aafd4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,5 @@ Flask==1.1.2 PyYAML>=4.2b1 python-http-client>=3.2.1 six==1.11.0 -pytest==3.8.2 starkbank-ecdsa>=2.0.1 more-itertools==5.0.0 diff --git a/test/unit/test_unassigned.py b/test/unit/test_unassigned.py index 6054447d8..08ab943bb 100644 --- a/test/unit/test_unassigned.py +++ b/test/unit/test_unassigned.py @@ -1,9 +1,7 @@ import json -import pytest from sendgrid.helpers.endpoints.ip.unassigned import unassigned - ret_json = '''[ { "ip": "167.89.21.3", "pools": [ @@ -69,8 +67,7 @@ def make_data(): def test_unassigned_ip_json(): - - data = make_data() + data = make_data() as_json = True calculated = unassigned(get_all_ip(), as_json=as_json) @@ -81,8 +78,7 @@ def test_unassigned_ip_json(): def test_unassigned_ip_obj(): - - data = make_data() + data = make_data() as_json = False calculated = unassigned(get_all_ip(), as_json=as_json) From 78615fcd2db479d2d06580fe35739539d68a285a Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Feb 2022 14:49:27 -0800 Subject: [PATCH 184/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e7d5c0be..f009359c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2022-02-09] Version 6.9.6 +-------------------------- +**Library - Chore** +- [PR #1044](https://github.com/sendgrid/sendgrid-python/pull/1044): drop pytest which was not being used. Thanks to [@childish-sambino](https://github.com/childish-sambino)! +- [PR #1043](https://github.com/sendgrid/sendgrid-python/pull/1043): upgrade supported language versions. Thanks to [@childish-sambino](https://github.com/childish-sambino)! +- [PR #1041](https://github.com/sendgrid/sendgrid-python/pull/1041): add gh release to workflow. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! +- [PR #1039](https://github.com/sendgrid/sendgrid-python/pull/1039): merge test and deploy workflows. Thanks to [@Hunga1](https://github.com/Hunga1)! + + [2022-01-26] Version 6.9.5 -------------------------- **Library - Docs** From f91a2162add712658b9f5e201f06c51a842cbd0a Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Feb 2022 14:49:28 -0800 Subject: [PATCH 185/237] Release 6.9.6 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 5b3835adf..eea67ac10 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.5' +__version__ = '6.9.6' From 082e3c57c7da4649018b36550f8512c4d99d0fd8 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Mon, 28 Feb 2022 15:42:42 -0800 Subject: [PATCH 186/237] chore: fix flask dependency test issues (#1050) --- test/requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/requirements.txt b/test/requirements.txt index 6cb2e96d2..17302b22e 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,6 +1,8 @@ pyyaml -flask +Flask==1.1.4 six coverage codecov mock +itsdangerous==1.1.0 +markupsafe==1.1.1 From 0b774384fb721196b12870d108f7bafe7c8c6b40 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Tue, 1 Mar 2022 09:53:43 -0800 Subject: [PATCH 187/237] chore: push Datadog Release Metric upon deploy success (#1049) --- .github/workflows/test-and-deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 842277933..ac0bca0a8 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -68,6 +68,11 @@ jobs: user: __token__ password: ${{ secrets.PYPI_TOKEN }} + - name: Submit metric to Datadog + uses: sendgrid/dx-automator/actions/datadog-release-metric@main + env: + DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + notify-on-failure: name: Slack notify on failure if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') From d7d292cf2241c18d052b8e3705dcc134cc0912d5 Mon Sep 17 00:00:00 2001 From: Vinicius Mesel Date: Fri, 4 Mar 2022 18:29:35 -0300 Subject: [PATCH 188/237] chore: Update mail_example.py (#1048) Co-authored-by: Elise Shanholtz --- examples/helpers/mail_example.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/helpers/mail_example.py b/examples/helpers/mail_example.py index 384181501..f6905787b 100644 --- a/examples/helpers/mail_example.py +++ b/examples/helpers/mail_example.py @@ -1,3 +1,6 @@ +import os +import json + from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import * @@ -8,11 +11,7 @@ def build_hello_email(): ## Send a Single Email to a Single Recipient - import os - import json - from sendgrid import SendGridAPIClient - from sendgrid.helpers.mail import Mail, From, To, Subject, PlainTextContent, HtmlContent, SendGridException - + message = Mail(from_email=From('from@example.com', 'Example From Name'), to_emails=To('to@example.com', 'Example To Name'), subject=Subject('Sending with SendGrid is Fun'), @@ -84,11 +83,8 @@ def get_mock_personalization_dict(): return mock_pers def build_multiple_emails_personalized(): - import json - from sendgrid.helpers.mail import Mail, From, To, Cc, Bcc, Subject, PlainTextContent, \ - HtmlContent, SendGridException, Personalization - # Note that the domain for all From email addresses must match + message = Mail(from_email=From('from@example.com', 'Example From Name'), subject=Subject('Sending with SendGrid is Fun'), plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), @@ -117,6 +113,7 @@ def build_multiple_emails_personalized(): def build_attachment1(): """Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content. Another example: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/attachment.md""" + attachment = Attachment() attachment.file_content = ("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl" "Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12") From d1a54500ac460fb9e392701925b1d9f21834581b Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Mar 2022 12:21:55 -0800 Subject: [PATCH 189/237] [Librarian] Version Bump --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f009359c4..a9d8f79db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Change Log All notable changes to this project will be documented in this file. +[2022-03-09] Version 6.9.7 +-------------------------- +**Library - Chore** +- [PR #1048](https://github.com/sendgrid/sendgrid-python/pull/1048): Update mail_example.py. Thanks to [@vmesel](https://github.com/vmesel)! +- [PR #1049](https://github.com/sendgrid/sendgrid-python/pull/1049): push Datadog Release Metric upon deploy success. Thanks to [@eshanholtz](https://github.com/eshanholtz)! +- [PR #1050](https://github.com/sendgrid/sendgrid-python/pull/1050): fix flask dependency test issues. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2022-02-09] Version 6.9.6 -------------------------- **Library - Chore** From 202fabc99073f1a61302d0e8ecb143e0d45bd8ce Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Mar 2022 12:21:55 -0800 Subject: [PATCH 190/237] Release 6.9.7 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index eea67ac10..59b5dedc7 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.6' +__version__ = '6.9.7' From e3d3ce500ba41f20ed6ce8f0b1a7fcb18882d917 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 24 Mar 2022 10:48:08 -0500 Subject: [PATCH 191/237] chore: remove outdated announcements --- README.md | 6 +----- README.rst | 10 +--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a653e38f9..321d86ca3 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors) [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-python/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-python) -**The default branch name for this repository has been changed to `main` as of 07/27/2020.** - **This library allows you to quickly and easily use the SendGrid Web API v3 via Python.** Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). @@ -187,9 +185,7 @@ Please see [our helper](sendgrid/helpers/inbound) for utilizing our Inbound Pars # Announcements -Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated! - -All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes. +All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). # How to Contribute diff --git a/README.rst b/README.rst index 59f693f0f..93062ba66 100644 --- a/README.rst +++ b/README.rst @@ -3,15 +3,12 @@ -|Tests Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| +|Tests Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python.** **NEW:** -**The default branch name for this repository has been changed to `main` as of 07/27/2020.** - -- Subscribe to email `notifications`_ for releases and breaking changes. - Version 6.X release is a BREAKING CHANGE from version 5.X, please see the `release notes`_ for details. - Send SMS messages with `Twilio`_. @@ -223,7 +220,6 @@ Announcements ============= All updates to this library are documented in our `CHANGELOG`_ and `releases`_. -You may also subscribe to email `release notifications`_ for releases and breaking changes. How to Contribute ================= @@ -253,7 +249,6 @@ License `The MIT License (MIT)`_ -.. _notifications: https://dx.sendgrid.com/newsletter/python .. _Twilio: https://github.com/sendgrid/sendgrid-python/blob/HEAD/use_cases/sms.md .. _release notes: https://github.com/sendgrid/sendgrid-python/releases/tag/v6.0.0 .. _Web API v3: https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html @@ -279,7 +274,6 @@ License .. _breaking changes: https://github.com/sendgrid/sendgrid-python/issues/217 .. _CHANGELOG: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CHANGELOG.md .. _releases: https://github.com/sendgrid/sendgrid-python/releases -.. _release notifications: https://dx.sendgrid.com/newsletter/python .. _CONTRIBUTING: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md .. _Feature Request: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#feature-request .. _Bug Reports: https://github.com/sendgrid/sendgrid-python/blob/HEAD/CONTRIBUTING.md#submit-a-bug-report @@ -298,8 +292,6 @@ License :target: https://codecov.io/gh/sendgrid/sendgrid-python .. |Docker Badge| image:: https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg :target: https://hub.docker.com/r/sendgrid/sendgrid-python/ -.. |Email Notifications Badge| image:: https://dx.sendgrid.com/badge/python - :target: https://dx.sendgrid.com/newsletter/python .. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg :target: ./LICENSE .. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow From 27843fe2d5b7fdf188f606ef20f2beab32b97eee Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Fri, 25 Mar 2022 13:39:50 -0500 Subject: [PATCH 192/237] feat: add PR title validation --- .github/workflows/pr-lint.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pr-lint.yml diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 000000000..8388f21e8 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,15 @@ +name: Lint PR +on: + pull_request_target: + types: [ opened, edited, reopened ] + +jobs: + validate: + name: Validate title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v4 + with: + types: chore docs fix feat test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 903c9cb87cf87d018a1d131b4903b4a300b92e0a Mon Sep 17 00:00:00 2001 From: Jonathan Berger Date: Tue, 29 Mar 2022 08:04:42 -0700 Subject: [PATCH 193/237] docs: Fix link that has drifted (#1052) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 321d86ca3..9ffdbb7d0 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ print(response.body) print(response.headers) ``` -The `Mail` constructor creates a [personalization object](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html) for you. [Here](examples/helpers/mail_example.py#L16) is an example of how to add it. +The `Mail` constructor creates a [personalization object](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html) for you. [Here](examples/helpers/mail_example.py#L28) is an example of how to add it. ### Without Mail Helper Class From 43c03bdd8baca80a80382bd6445a7c6021d697fa Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 21 Apr 2022 14:44:33 -0500 Subject: [PATCH 194/237] test: lint PRs on synchronize events Since synchronize events clears the status checks, it needs to be re-run. --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 8388f21e8..dc7af3d3c 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,7 @@ name: Lint PR on: pull_request_target: - types: [ opened, edited, reopened ] + types: [ opened, edited, synchronize, reopened ] jobs: validate: From c798252a31949b9b263f9722294eb94ba3bb1e33 Mon Sep 17 00:00:00 2001 From: "Gareth Paul Jones (GPJ)" Date: Mon, 9 May 2022 10:03:43 -0700 Subject: [PATCH 195/237] docs: Modify README.md in alignment with SendGrid Support (#1055) --- .github/ISSUE_TEMPLATE/config.yml | 10 ---------- ISSUE_TEMPLATE.md | 30 ------------------------------ PULL_REQUEST_TEMPLATE.md | 2 +- README.md | 10 ++++++---- test/unit/test_project.py | 4 ---- 5 files changed, 7 insertions(+), 49 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index afcba3446..000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -contact_links: - - name: Twilio SendGrid Support - url: https://support.sendgrid.com - about: Get Support - - name: Stack Overflow - url: https://stackoverflow.com/questions/tagged/sendgrid-python+or+sendgrid+python - about: Ask questions on Stack Overflow - - name: Documentation - url: https://sendgrid.com/docs/for-developers/ - about: View Reference Documentation diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index fb2e15cef..000000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,30 +0,0 @@ - - -### Issue Summary -A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples. - -### Steps to Reproduce -1. This is the first step -2. This is the second step -3. Further steps, etc. - -### Code Snippet -```python -# paste code here -``` - -### Exception/Log -``` -# paste exception/log here -``` - -### Technical details: -* sendgrid-python version: -* python version: - diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 7c2789ae4..f78ab3918 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -28,4 +28,4 @@ A short description of what this PR does. - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified -If you have questions, please file a [support ticket](https://support.sendgrid.com), or create a GitHub Issue in this repository. +If you have questions, please file a [support ticket](https://support.sendgrid.com). \ No newline at end of file diff --git a/README.md b/README.md index 9ffdbb7d0..663d1e977 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Version 3.X.X+ of this library provides full support for all SendGrid [Web API v This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-python/issues) and [pull requests](CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests. -Please browse the rest of this README for further detail. +**If you need help using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).** -We appreciate your continued support, thank you! +Please browse the rest of this README for further detail. # Table of Contents @@ -28,6 +28,7 @@ We appreciate your continued support, thank you! * [How to Contribute](#contribute) * [Troubleshooting](#troubleshooting) * [About](#about) +* [Support](#support) * [License](#license) @@ -209,9 +210,10 @@ Please see our [troubleshooting guide](TROUBLESHOOTING.md) for common library is sendgrid-python is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-python are trademarks of Twilio SendGrid, Inc. -If you need help installing or using the library, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com). + +# Support -If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo! +If you need support, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com). # License diff --git a/test/unit/test_project.py b/test/unit/test_project.py index c78293dff..40282bdb7 100644 --- a/test/unit/test_project.py +++ b/test/unit/test_project.py @@ -23,10 +23,6 @@ def test_code_of_conduct(self): def test_contributing(self): self.assertTrue(os.path.isfile('./CONTRIBUTING.md')) - # ./ISSUE_TEMPLATE.md - def test_issue_template(self): - self.assertTrue(os.path.isfile('./ISSUE_TEMPLATE.md')) - # ./LICENSE def test_license(self): self.assertTrue(os.path.isfile('./LICENSE')) From 17a7bcc94f3c02f7cf9327139378d1f5e06cac50 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 12 May 2022 10:28:26 -0500 Subject: [PATCH 196/237] chore: drop the issue links from FIRST_TIMERS doc --- FIRST_TIMERS.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index 528580c34..a1d563a75 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -51,29 +51,3 @@ git push origin ## Important notice Before creating a pull request, make sure that you respect the repository's constraints regarding contributions. You can find them in the [CONTRIBUTING.md](CONTRIBUTING.md) file. - -## Repositories with Open, Easy, Help Wanted, Issue Filters - -* [Python SDK](https://github.com/sendgrid/sendgrid-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP SDK](https://github.com/sendgrid/sendgrid-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# SDK](https://github.com/sendgrid/sendgrid-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby SDK](https://github.com/sendgrid/sendgrid-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Python SMTPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP SMTPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# SMTPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby SMTPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Node.js SMTPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java SMTPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go SMTPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java HTTP Client](https://github.com/sendgrid/java-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby HTTP Client](https://github.com/sendgrid/ruby-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go HTTP Client](https://github.com/sendgrid/rest/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Open API Definition](https://github.com/sendgrid/sendgrid-oai/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [DX Automator](https://github.com/sendgrid/dx-automator/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Documentation](https://github.com/sendgrid/docs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) From ef1aa7293e4cda85dcba1cba4524d3e85d8e0281 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Mon, 23 May 2022 11:04:22 -0500 Subject: [PATCH 197/237] docs: drop references to ISSUE_TEMPLATE.md Issues are no longer supported so file was previously removed. --- CONTRIBUTING.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2769176d..890641059 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,9 +2,6 @@ Hello! Thank you for choosing to help contribute to one of the Twilio SendGrid o All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under. -- [Feature Request](#feature-request) -- [Submit a Bug Report](#submit-a-bug-report) - - [Please use our Bug Report Template](#please-use-our-bug-report-template) - [Improvements to the Codebase](#improvements-to-the-codebase) - [Development Environment](#development-environment) - [Prerequisites](#prerequisites) @@ -19,31 +16,6 @@ All third party contributors acknowledge that any contributions they provide wil There are a few ways to contribute, which we'll enumerate below: -## Feature Request - -If you'd like to make a feature request, please read this section. - -The GitHub issue tracker is the preferred channel for library feature requests, but please respect the following restrictions: - -- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests. -- Please be respectful and considerate of others when commenting on issues - -## Submit a Bug Report - -Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public. - -A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report. - -Before you decide to create a new issue, please try the following: - -1. Check the GitHub issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post. -2. Update to the latest version of this code and check if the issue has already been fixed -3. Copy and fill in the Bug Report Template we have provided below - -### Please use our Bug Report Template - -In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md). - ## Improvements to the Codebase We welcome direct contributions to the sendgrid-python code base. Thank you! From 653cc47c54d53d401d65d1debb3cdc1d7905b4a1 Mon Sep 17 00:00:00 2001 From: Raghav Katyal Date: Wed, 6 Jul 2022 16:14:12 -0700 Subject: [PATCH 198/237] Adding misc as PR type (#1058) --- .github/workflows/pr-lint.yml | 2 +- PULL_REQUEST_TEMPLATE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index dc7af3d3c..2f5232b08 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: amannn/action-semantic-pull-request@v4 with: - types: chore docs fix feat test + types: chore docs fix feat test misc env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index f78ab3918..f9448a3b1 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ We appreciate the effort for this pull request but before that please make sure Please format the PR title appropriately based on the type of change: [!]: -Where is one of: docs, chore, feat, fix, test. +Where is one of: docs, chore, feat, fix, test, misc. Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature). **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.** From 4288aa618b04a3e99173f59ce43d7a4b379b93c4 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Tue, 3 Jan 2023 09:09:32 -0600 Subject: [PATCH 199/237] docs: updated the year in the license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5db04ff6d..3154774a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2022, Twilio SendGrid, Inc. +Copyright (C) 2023, Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 9e8a2599bd86d599465552de591d2ca5413fb101 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Mar 2023 15:46:49 +0100 Subject: [PATCH 200/237] feat: Add Python 3.11 to the testing (#1059) --- .github/workflows/test-and-deploy.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index ac0bca0a8..f14974e43 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11' ] env: DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }} steps: diff --git a/setup.py b/setup.py index 7e84802f4..41f11e589 100644 --- a/setup.py +++ b/setup.py @@ -34,12 +34,12 @@ def getRequires(): classifiers=[ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ] ) From 93612afeb0114cd98b6efd7c82dbcf98c9a4df27 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Mar 2023 15:57:25 +0100 Subject: [PATCH 201/237] misc: Upgrade GitHub Action pr-lint.yml (#1063) --- .github/workflows/pr-lint.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 2f5232b08..31520079c 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -8,8 +8,14 @@ jobs: name: Validate title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v4 + - uses: amannn/action-semantic-pull-request@v5 with: - types: chore docs fix feat test misc + types: | + chore + docs + fix + feat + misc + test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 102842a9dbeb1cabe057ffc0e52603f2dbc44596 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Mar 2023 16:05:34 +0100 Subject: [PATCH 202/237] misc: Upgrade GitHub Action test-and-deploy.yml (#1064) --- .github/workflows/test-and-deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index f14974e43..4db532e3d 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -22,11 +22,11 @@ jobs: DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }} steps: - name: Checkout sendgrid-python - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login to Docker Hub if: env.DOCKER_LOGIN - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_AUTH_TOKEN }} @@ -41,10 +41,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sendgrid-python - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.10' From c8076fa684d66ed5c0569feaf7b99dbedd976b77 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Mar 2023 17:11:47 +0100 Subject: [PATCH 203/237] misc: Create GitHub Action to lint Python code (#1065) --- .github/workflows/lint-python.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/lint-python.yml diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml new file mode 100644 index 000000000..1c5f53f23 --- /dev/null +++ b/.github/workflows/lint-python.yml @@ -0,0 +1,16 @@ +# https://beta.ruff.rs +name: ruff +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install --user ruff + - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 . From 4b5c605dda41dbf6dab9ed4ea72ff4014a735885 Mon Sep 17 00:00:00 2001 From: iLan Date: Tue, 21 Mar 2023 11:28:49 -0700 Subject: [PATCH 204/237] feat: Add reply_to_list functionality (#1062) --- sendgrid/helpers/mail/mail.py | 28 ++++++ test/unit/test_mail_helpers.py | 90 +++++++++++++++++++ ..._email_with_multiple_reply_to_addresses.md | 29 ++++++ 3 files changed, 147 insertions(+) create mode 100644 use_cases/send_a_single_email_with_multiple_reply_to_addresses.md diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index ba21f7891..2472ad7d3 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -60,6 +60,7 @@ def __init__( self._ip_pool_name = None self._mail_settings = None self._reply_to = None + self._reply_to_list = None self._send_at = None self._subject = None self._template_id = None @@ -695,6 +696,32 @@ def reply_to(self, value): value = ReplyTo(value[0], value[1]) self._reply_to = value + @property + def reply_to_list(self): + """A list of ReplyTo email addresses + + :rtype: list(ReplyTo), tuple + """ + return self._reply_to_list + + @reply_to_list.setter + def reply_to_list(self, value): + """A list of ReplyTo email addresses + + :param value: A list of ReplyTo email addresses + :type value: list(ReplyTo), tuple + """ + if isinstance(value, list): + for reply in value: + if isinstance(reply, ReplyTo): + if not isinstance(reply.email, str): + raise ValueError('You must provide an email for each entry in a reply_to_list') + else: + raise ValueError( + 'Please use a list of ReplyTos for a reply_to_list.' + ) + self._reply_to_list = value + @property def contents(self): """The contents of the email @@ -981,6 +1008,7 @@ def get(self): 'mail_settings': self._get_or_none(self.mail_settings), 'tracking_settings': self._get_or_none(self.tracking_settings), 'reply_to': self._get_or_none(self.reply_to), + 'reply_to_list': [r.get() for r in self.reply_to_list or []], } return {key: value for key, value in mail.items() diff --git a/test/unit/test_mail_helpers.py b/test/unit/test_mail_helpers.py index a7d08d890..c00307d46 100644 --- a/test/unit/test_mail_helpers.py +++ b/test/unit/test_mail_helpers.py @@ -235,6 +235,58 @@ def test_send_a_single_email_to_multiple_recipients(self): }''') ) + def test_send_a_single_email_with_multiple_reply_to_addresses(self): + from sendgrid.helpers.mail import (Mail, From, ReplyTo, To, Subject, + PlainTextContent, HtmlContent) + self.maxDiff = None + message = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=To('test+to0@example.com', 'Example To Name'), + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent('and easy to do anywhere, even with Python'), + html_content=HtmlContent('and easy to do anywhere, even with Python')) + + message.reply_to_list = [ReplyTo(email = 'test+reply_to_1@example.com'), ReplyTo(email = 'test+reply_to_2@example.com')] + + self.assertEqual( + message.get(), + json.loads(r'''{ + "content": [ + { + "type": "text/plain", + "value": "and easy to do anywhere, even with Python" + }, + { + "type": "text/html", + "value": "and easy to do anywhere, even with Python" + } + ], + "from": { + "email": "test+from@example.com", + "name": "Example From Name" + }, + "personalizations": [ + { + "to": [ + { + "email": "test+to0@example.com", + "name": "Example To Name" + } + ] + } + ], + "reply_to_list": [ + { + "email": "test+reply_to_1@example.com" + }, + { + "email": "test+reply_to_2@example.com" + } + ], + "subject": "Sending with SendGrid is Fun" + }''') + ) + def test_multiple_emails_to_multiple_recipients(self): from sendgrid.helpers.mail import (Mail, From, To, Subject, PlainTextContent, HtmlContent, @@ -568,6 +620,44 @@ def test_value_error_is_raised_on_to_emails_set_to_list_of_lists(self): 'and easy to do anywhere, even with Python'), html_content=HtmlContent( 'and easy to do anywhere, even with Python')) + + def test_value_error_is_raised_on_to_emails_set_to_reply_to_list_of_strs(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = [ + ('test+to0@example.com', 'Example To Name 0'), + ('test+to1@example.com', 'Example To Name 1') + ] + + mail = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + with self.assertRaises(ValueError): + mail.reply_to_list = ['test+reply_to0@example.com', 'test+reply_to1@example.com'] + + def test_value_error_is_raised_on_to_emails_set_to_reply_to_list_of_tuples(self): + from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) + self.maxDiff = None + to_emails = [ + ('test+to0@example.com', 'Example To Name 0'), + ('test+to1@example.com', 'Example To Name 1') + ] + + mail = Mail( + from_email=From('test+from@example.com', 'Example From Name'), + to_emails=to_emails, + subject=Subject('Sending with SendGrid is Fun'), + plain_text_content=PlainTextContent( + 'and easy to do anywhere, even with Python'), + html_content=HtmlContent( + 'and easy to do anywhere, even with Python')) + with self.assertRaises(ValueError): + mail.reply_to_list = [('test+reply_to@example.com', 'Test Name')] def test_error_is_not_raised_on_to_emails_set_to_list_of_tuples(self): from sendgrid.helpers.mail import (PlainTextContent, HtmlContent) diff --git a/use_cases/send_a_single_email_with_multiple_reply_to_addresses.md b/use_cases/send_a_single_email_with_multiple_reply_to_addresses.md new file mode 100644 index 000000000..55d6adf18 --- /dev/null +++ b/use_cases/send_a_single_email_with_multiple_reply_to_addresses.md @@ -0,0 +1,29 @@ +```python +import os +from sendgrid import SendGridAPIClient +from sendgrid.helpers.mail import Mail + +message = Mail( + from_email='from_email@example.com', + to_emails='to@example.com', + subject='Sending with Twilio SendGrid is Fun', + html_content='and easy to do anywhere, even with Python') +message.reply_to_list = [ + ReplyTo( + email='reply-to-1@example.com', + name="Reply To Name 1", + ), + ReplyTo( + email='reply-to-2@example.com', + name="Reply To Name 2", + ) +] +try: + sendgrid_client = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) + response = sendgrid_client.send(message) + print(response.status_code) + print(response.body) + print(response.headers) +except Exception as e: + print(e) +``` From 9fe3e235d06475573b27fb521d31a592799cf8a6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 22 Mar 2023 11:45:20 -0700 Subject: [PATCH 205/237] [Librarian] Version Bump --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d8f79db..802270cd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,25 @@ # Change Log All notable changes to this project will be documented in this file. +[2023-03-22] Version 6.10.0 +--------------------------- +**Library - Feature** +- [PR #1062](https://github.com/sendgrid/sendgrid-python/pull/1062): Add reply_to_list functionality. Thanks to [@thepuzzlemaster](https://github.com/thepuzzlemaster)! +- [PR #1059](https://github.com/sendgrid/sendgrid-python/pull/1059): Add Python 3.11 to the testing. Thanks to [@cclauss](https://github.com/cclauss)! + +**Library - Miscellaneous** +- [PR #1065](https://github.com/sendgrid/sendgrid-python/pull/1065): Create GitHub Action to lint Python code. Thanks to [@cclauss](https://github.com/cclauss)! +- [PR #1064](https://github.com/sendgrid/sendgrid-python/pull/1064): Upgrade GitHub Action test-and-deploy.yml. Thanks to [@cclauss](https://github.com/cclauss)! +- [PR #1063](https://github.com/sendgrid/sendgrid-python/pull/1063): Upgrade GitHub Action pr-lint.yml. Thanks to [@cclauss](https://github.com/cclauss)! + +**Library - Test** +- [PR #1058](https://github.com/sendgrid/sendgrid-python/pull/1058): Adding misc as PR type. Thanks to [@rakatyal](https://github.com/rakatyal)! + +**Library - Docs** +- [PR #1055](https://github.com/sendgrid/sendgrid-python/pull/1055): Modify README.md in alignment with SendGrid Support. Thanks to [@garethpaul](https://github.com/garethpaul)! +- [PR #1052](https://github.com/sendgrid/sendgrid-python/pull/1052): Fix link that has drifted. Thanks to [@jonathanberger](https://github.com/jonathanberger)! + + [2022-03-09] Version 6.9.7 -------------------------- **Library - Chore** From 5e9687caf9ed643362220e239b71537ed539c535 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 22 Mar 2023 11:45:21 -0700 Subject: [PATCH 206/237] Release 6.10.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 59b5dedc7..466501d04 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.9.7' +__version__ = '6.10.0' From 2fe145956a1ee50355f5da8deab401e1e118c736 Mon Sep 17 00:00:00 2001 From: Seth Ammons Date: Mon, 17 Apr 2023 04:48:43 -0400 Subject: [PATCH 207/237] fix: removing codedev test dependency (#1066) Fix build by removing dead dependency. Per the announcment: https://about.codecov.io/blog/message-regarding-the-pypi-package/ coddev deprecated their pypi package on april 12, 2023 causing the build to break We no longer are registered at codedev: https://app.codecov.io/gh/sendgrid/sendgrid-python "This repo has been deactivated" --- README.rst | 4 +--- test/requirements.txt | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 93062ba66..e23e2300e 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ -|Tests Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| +|Tests Badge| |Python Versions| |PyPI Version| |Docker Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers| **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python.** @@ -288,8 +288,6 @@ License :target: https://pypi.org/project/sendgrid/ .. |PyPI Version| image:: https://img.shields.io/pypi/v/sendgrid.svg :target: https://pypi.org/project/sendgrid/ -.. |codecov| image:: https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage - :target: https://codecov.io/gh/sendgrid/sendgrid-python .. |Docker Badge| image:: https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg :target: https://hub.docker.com/r/sendgrid/sendgrid-python/ .. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg diff --git a/test/requirements.txt b/test/requirements.txt index 17302b22e..859c2456d 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -2,7 +2,6 @@ pyyaml Flask==1.1.4 six coverage -codecov mock itsdangerous==1.1.0 markupsafe==1.1.1 From bcb4f3379ec07f8d337d7aaa63d461259ec5ee41 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Tue, 14 Nov 2023 15:44:25 +0530 Subject: [PATCH 208/237] feat: geolocation setter in sendgrid-python for GDPR compliance --- .github/workflows/lint-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml index 1c5f53f23..ba064864c 100644 --- a/.github/workflows/lint-python.yml +++ b/.github/workflows/lint-python.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v3 - run: pip install --user ruff - - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 . + - run: ruff --format=github --ignore="E722,F40,F841" --line-length=320 --target-version=py37 . From d3ddc8aa27707ec5e2b13a65dfa4c1e2bc837497 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Tue, 14 Nov 2023 15:46:52 +0530 Subject: [PATCH 209/237] revert changes --- .github/workflows/lint-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml index ba064864c..1c5f53f23 100644 --- a/.github/workflows/lint-python.yml +++ b/.github/workflows/lint-python.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v3 - run: pip install --user ruff - - run: ruff --format=github --ignore="E722,F40,F841" --line-length=320 --target-version=py37 . + - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 . From b5afcca6c2c4b29330f81f92b79bf2526645223a Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Fri, 24 Nov 2023 00:29:36 +0530 Subject: [PATCH 210/237] feat: geolocation setter in sendgrid-python for GDPR compliance (#1073) --- .github/workflows/lint-python.yml | 2 +- examples/dataresidency/set_region.py | 37 ++++++++++++++++++++++++++++ sendgrid/base_interface.py | 23 ++++++++++++++++- test/unit/test_sendgrid.py | 27 ++++++++++++++++++++ 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 examples/dataresidency/set_region.py create mode 100644 test/unit/test_sendgrid.py diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml index 1c5f53f23..ace47f77d 100644 --- a/.github/workflows/lint-python.yml +++ b/.github/workflows/lint-python.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v3 - run: pip install --user ruff - - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 . + - run: ruff --ignore="E722,F40,F841" --line-length=320 --target-version=py37 . diff --git a/examples/dataresidency/set_region.py b/examples/dataresidency/set_region.py new file mode 100644 index 000000000..9aae2611f --- /dev/null +++ b/examples/dataresidency/set_region.py @@ -0,0 +1,37 @@ +import sendgrid +import os + +from sendgrid import Email, To, Content, Mail + +# Example 1 +# setting region to be "global" + +sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) +from_email = Email("example@abc.com") +to_email = To("example@abc.com") +subject = "Sending with SendGrid is Fun" +content = Content("text/plain", "and easy to do anywhere, even with Python") +mail = Mail(from_email, to_email, subject, content) +sg.set_sendgrid_data_residency("global") +print(sg.client.host) +response = sg.client.mail.send.post(request_body=mail.get()) +print(response) +print(response.status_code) +print(response.body) +print(response.headers) + +# Example 2 +# setting region to "eu" +sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY_EU')) +sg.set_sendgrid_data_residency("eu") +from_email = Email("example@abc.com") +to_email = To("example@abc.com") +subject = "Sending with SendGrid is Fun" +content = Content("text/plain", "and easy to do anywhere, even with Python") +print(sg.client.host) +mail = Mail(from_email, to_email, subject, content) +response = sg.client.mail.send.post(request_body=mail.get()) +print(response) +print(response.status_code) +print(response.body) +print(response.headers) \ No newline at end of file diff --git a/sendgrid/base_interface.py b/sendgrid/base_interface.py index 92b38247e..f94f09479 100644 --- a/sendgrid/base_interface.py +++ b/sendgrid/base_interface.py @@ -1,5 +1,6 @@ import python_http_client +region_host_dict = {'eu':'https://api.eu.sendgrid.com','global':'https://api.sendgrid.com'} class BaseInterface(object): def __init__(self, auth, host, impersonate_subuser): @@ -22,10 +23,10 @@ def __init__(self, auth, host, impersonate_subuser): """ from . import __version__ self.auth = auth - self.host = host self.impersonate_subuser = impersonate_subuser self.version = __version__ self.useragent = 'sendgrid/{};python'.format(self.version) + self.host = host self.client = python_http_client.Client( host=self.host, @@ -60,3 +61,23 @@ def send(self, message): message = message.get() return self.client.mail.send.post(request_body=message) + + def set_sendgrid_data_residency(self, region): + """ + Client libraries contain setters for specifying region/edge. + This supports global and eu regions only. This set will likely expand in the future. + Global is the default residency (or region) + Global region means the message will be sent through https://api.sendgrid.com + EU region means the message will be sent through https://api.eu.sendgrid.com + :param region: string + :return: + """ + if region in region_host_dict.keys(): + self.host = region_host_dict[region] + if self._default_headers is not None: + self.client = python_http_client.Client( + host=self.host, + request_headers=self._default_headers, + version=3) + else: + raise ValueError("region can only be \"eu\" or \"global\"") diff --git a/test/unit/test_sendgrid.py b/test/unit/test_sendgrid.py new file mode 100644 index 000000000..328d978ab --- /dev/null +++ b/test/unit/test_sendgrid.py @@ -0,0 +1,27 @@ +import unittest +import sendgrid + +class UnitTests(unittest.TestCase): + def test_host_with_no_region(self): + sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') + self.assertEqual("https://api.sendgrid.com",sg.client.host) + + def test_host_with_eu_region(self): + sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') + sg.set_sendgrid_data_residency("eu") + self.assertEqual("https://api.eu.sendgrid.com",sg.client.host) + + def test_host_with_global_region(self): + sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') + sg.set_sendgrid_data_residency("global") + self.assertEqual("https://api.sendgrid.com",sg.client.host) + + def test_with_region_is_none(self): + sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') + with self.assertRaises(ValueError): + sg.set_sendgrid_data_residency(None) + + def test_with_region_is_invalid(self): + sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') + with self.assertRaises(ValueError): + sg.set_sendgrid_data_residency("abc") \ No newline at end of file From 4804d32b17e9d396e319c1943792537dc1846008 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 1 Dec 2023 05:16:21 +0000 Subject: [PATCH 211/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 802270cd8..4415a03f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2023-12-01] Version 6.11.0 +--------------------------- +**Library - Feature** +- [PR #1073](https://github.com/sendgrid/sendgrid-python/pull/1073): geolocation setter in sendgrid-python for GDPR compliance. Thanks to [@manisha1997](https://github.com/manisha1997)! + +**Library - Test** +- [PR #1066](https://github.com/sendgrid/sendgrid-python/pull/1066): removing codedev test dependency. Thanks to [@sethgrid](https://github.com/sethgrid)! + + [2023-03-22] Version 6.10.0 --------------------------- **Library - Feature** From 4e4ac47e61f52b9ead5020f807f4eb151f9a0bc6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 1 Dec 2023 05:16:22 +0000 Subject: [PATCH 212/237] Release 6.11.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 466501d04..901082d42 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.10.0' +__version__ = '6.11.0' From 78acb96d25a299ad862396c1fbc399c897998bfd Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Tue, 26 Dec 2023 13:53:33 +0530 Subject: [PATCH 213/237] chore: commit to main to check if the commits go directly into main. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 663d1e977..d41c0a1c4 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ response = sg.client.mail.send.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) + ``` ## General v3 Web API Usage (With [Fluent Interface](https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/)) From 9515dce6c8229c9cf7272701d0c2664c05727f16 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Tue, 26 Dec 2023 13:54:42 +0530 Subject: [PATCH 214/237] chore: rolling back direct commits --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d41c0a1c4..663d1e977 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,6 @@ response = sg.client.mail.send.post(request_body=data) print(response.status_code) print(response.body) print(response.headers) - ``` ## General v3 Web API Usage (With [Fluent Interface](https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/)) From e2a2cfd7c0632ead3ecdeb725ec4798b711a7931 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 11 Apr 2025 15:00:51 +0530 Subject: [PATCH 215/237] chore: install docker-compose (#1099) * chore: install docker-compose * chore: update licence year * chore: fix lint-python --- .github/workflows/lint-python.yml | 2 +- .github/workflows/test-and-deploy.yml | 5 +++++ LICENSE | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml index ace47f77d..5dcf0328c 100644 --- a/.github/workflows/lint-python.yml +++ b/.github/workflows/lint-python.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v3 - run: pip install --user ruff - - run: ruff --ignore="E722,F40,F841" --line-length=320 --target-version=py37 . + - run: ruff check --ignore="E722,F40,F841" --line-length=320 --target-version=py37 . diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 4db532e3d..25408ac0a 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -31,6 +31,11 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_AUTH_TOKEN }} + - name: Install Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + - name: Build & Test run: make test-docker version=${{ matrix.python-version }} diff --git a/LICENSE b/LICENSE index 3154774a9..126ceb1a3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2023, Twilio SendGrid, Inc. +Copyright (C) 2025, Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From ee54d81051d45b0a667642866b74dc7efbc7155b Mon Sep 17 00:00:00 2001 From: Meysam Date: Tue, 15 Apr 2025 22:05:45 +0700 Subject: [PATCH 216/237] feat: add support for python3.12 and 3.13 (#1087) --- .github/workflows/test-and-deploy.yml | 2 +- Makefile | 6 ++--- setup.py | 2 ++ test/requirements.txt | 1 + tox.ini | 32 ++++++++++++++++++++++++++- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 25408ac0a..ba8b69905 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11' ] + python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' , '3.13'] env: DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }} steps: diff --git a/Makefile b/Makefile index fb61004ce..96161106d 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,11 @@ venv: clean virtualenv --python=python venv install: venv + . venv/bin/activate; pip install -r test/requirements.txt . venv/bin/activate; python setup.py install . venv/bin/activate; pip install -r requirements.txt -test-install: install - . venv/bin/activate; pip install -r test/requirements.txt - -test: test-install +test: install . venv/bin/activate; coverage run -m unittest discover -s test/unit test-integ: test diff --git a/setup.py b/setup.py index 41f11e589..7c797ae67 100644 --- a/setup.py +++ b/setup.py @@ -41,5 +41,7 @@ def getRequires(): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ] ) diff --git a/test/requirements.txt b/test/requirements.txt index 859c2456d..40552deba 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -5,3 +5,4 @@ coverage mock itsdangerous==1.1.0 markupsafe==1.1.1 +setuptools diff --git a/tox.ini b/tox.ini index 926a3c9dd..8f4f2db9a 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py27, py34, py35, py36, py37 +envlist = py27, py34, py35, py36, py37, py38, py39, py310, py311, py312, py313 [testenv] commands = coverage erase @@ -39,3 +39,33 @@ basepython = python3.6 commands = {[testenv]commands} deps = {[testenv]deps} basepython = python3.7 + +[testenv:py38] +commands = {[testenv]commands} +deps = {[testenv]deps} +basepython = python3.8 + +[testenv:py39] +commands = {[testenv]commands} +deps = {[testenv]deps} +basepython = python3.9 + +[testenv:py310] +commands = {[testenv]commands} +deps = {[testenv]deps} +basepython = python3.10 + +[testenv:py311] +commands = {[testenv]commands} +deps = {[testenv]deps} +basepython = python3.11 + +[testenv:py312] +commands = {[testenv]commands} +deps = {[testenv]deps} +basepython = python3.12 + +[testenv:py313] +commands = {[testenv]commands} +deps = {[testenv]deps} +basepython = python3.13 From 09bc8466ddf1ecd11a6dc7ebb7a8338fb5afca86 Mon Sep 17 00:00:00 2001 From: GPK Date: Fri, 25 Apr 2025 14:06:33 +0100 Subject: [PATCH 217/237] chore: Add werkzeug package to setup file (#1098) * Add werkzeug package to setup file * Add werkzeug package to setup file * Update versions * Remove EOL python versions --------- Co-authored-by: Shubham --- .github/workflows/test-and-deploy.yml | 2 +- setup.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index ba8b69905..959970d94 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' , '3.13'] + python-version: [ '3.9', '3.10', '3.11', '3.12' , '3.13'] env: DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }} steps: diff --git a/setup.py b/setup.py index 7c797ae67..0753e3997 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,11 @@ def getRequires(): deps = [ 'python_http_client>=3.2.1', - 'starkbank-ecdsa>=2.0.1' + 'starkbank-ecdsa>=2.0.1', + "werkzeug>=0.11.15,<1.0.0 ; python_version < '3.0'", + "werkzeug>=0.15.0,<2.0.0 ; python_version >= '3.0' and python_version < '3.6'", + "werkzeug>=2.0.0,<3.0.0 ; python_version >= '3.6' and python_version < '3.11'", + "werkzeug>=3.0.0 ; python_version >= '3.11'" ] return deps From ac693fe02295e5e0b77070bab6fa460c697f8997 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 5 May 2025 10:35:35 +0000 Subject: [PATCH 218/237] [Librarian] Version Bump --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4415a03f7..a2215795b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. +[2025-05-05] Version 6.12.0 +--------------------------- +**Library - Chore** +- [PR #1098](https://github.com/sendgrid/sendgrid-python/pull/1098): Add werkzeug package to setup file. Thanks to [@gopidesupavan](https://github.com/gopidesupavan)! +- [PR #1099](https://github.com/sendgrid/sendgrid-python/pull/1099): install docker-compose. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Library - Feature** +- [PR #1087](https://github.com/sendgrid/sendgrid-python/pull/1087): add support for python3.12 and 3.13. Thanks to [@meysam81](https://github.com/meysam81)! + + [2023-12-01] Version 6.11.0 --------------------------- **Library - Feature** From 774663f5a0af011d23908d0dbd932cb64ee96d70 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 5 May 2025 10:35:35 +0000 Subject: [PATCH 219/237] Release 6.12.0 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 901082d42..142f2122e 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.11.0' +__version__ = '6.12.0' From 6eb4375f4d1ef1e0c1ad17d07858706291380ebc Mon Sep 17 00:00:00 2001 From: ranjanprasad1996 <141220652+ranjanprasad1996@users.noreply.github.com> Date: Fri, 9 May 2025 20:54:52 +0530 Subject: [PATCH 220/237] fix: Vulnerability fix for starkbank-ecdsa 2.2.0 dependency (#1085) * Updated webhook helper to use a different edcsa library * chore: dummy commit * Update dependencies --------- Co-authored-by: Shubham --- requirements.txt | 6 ++--- sendgrid/helpers/eventwebhook/__init__.py | 30 +++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0c34aafd4..c95204480 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -Flask==1.1.2 +Flask==3.1.0 PyYAML>=4.2b1 python-http-client>=3.2.1 -six==1.11.0 -starkbank-ecdsa>=2.0.1 +six==1.17.0 +ecdsa>=0.19.1,<1 more-itertools==5.0.0 diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py index c1ec7d1c8..d97604df8 100644 --- a/sendgrid/helpers/eventwebhook/__init__.py +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -1,8 +1,7 @@ -from ellipticcurve.ecdsa import Ecdsa -from ellipticcurve.publicKey import PublicKey -from ellipticcurve.signature import Signature - -from .eventwebhook_header import EventWebhookHeader +from ecdsa import VerifyingKey, BadSignatureError +from ecdsa.util import sigdecode_der +import base64 +import hashlib class EventWebhook: """ @@ -20,14 +19,15 @@ def __init__(self, public_key=None): def convert_public_key_to_ecdsa(self, public_key): """ - Convert the public key string to a ECPublicKey. + Convert the public key string to a VerifyingKey object. :param public_key: verification key under Mail Settings :type public_key string - :return: public key using the ECDSA algorithm - :rtype PublicKey + :return: VerifyingKey object using the ECDSA algorithm + :rtype VerifyingKey """ - return PublicKey.fromPem('\n-----BEGIN PUBLIC KEY-----\n'+public_key+'\n-----END PUBLIC KEY-----\n') + pem_key = "-----BEGIN PUBLIC KEY-----\n" + public_key + "\n-----END PUBLIC KEY-----" + return VerifyingKey.from_pem(pem_key) def verify_signature(self, payload, signature, timestamp, public_key=None): """ @@ -40,11 +40,15 @@ def verify_signature(self, payload, signature, timestamp, public_key=None): :param timestamp: value obtained from the 'X-Twilio-Email-Event-Webhook-Timestamp' header :type timestamp: string :param public_key: elliptic curve public key - :type public_key: PublicKey + :type public_key: VerifyingKey :return: true or false if signature is valid """ - timestamped_payload = timestamp + payload - decoded_signature = Signature.fromBase64(signature) + timestamped_payload = (timestamp + payload).encode('utf-8') + decoded_signature = base64.b64decode(signature) key = public_key or self.public_key - return Ecdsa.verify(timestamped_payload, decoded_signature, key) + try: + key.verify(decoded_signature, timestamped_payload, hashfunc=hashlib.sha256, sigdecode=sigdecode_der) + return True + except BadSignatureError: + return False From 096719d8daf5846664eb3f6b4649c826176a959c Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 13 May 2025 09:44:12 +0000 Subject: [PATCH 221/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2215795b..2936c9a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2025-05-13] Version 6.12.1 +--------------------------- +**Library - Fix** +- [PR #1085](https://github.com/sendgrid/sendgrid-python/pull/1085): Vulnerability fix for starkbank-ecdsa 2.2.0 dependency. Thanks to [@ranjanprasad1996](https://github.com/ranjanprasad1996)! + + [2025-05-05] Version 6.12.0 --------------------------- **Library - Chore** From 2acb010ae303cca78d696b82b739809b7f319187 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 13 May 2025 09:44:12 +0000 Subject: [PATCH 222/237] Release 6.12.1 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 142f2122e..431e91f2e 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.12.0' +__version__ = '6.12.1' From e1ed323bb0a595b7488fbb0c8d8351682ff97f55 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 13 May 2025 16:19:25 +0530 Subject: [PATCH 223/237] chore: update ecdsa in setup.py (#1102) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0753e3997..b3a8e5c86 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ def getRequires(): deps = [ 'python_http_client>=3.2.1', - 'starkbank-ecdsa>=2.0.1', + 'ecdsa>=0.19.1,<1', "werkzeug>=0.11.15,<1.0.0 ; python_version < '3.0'", "werkzeug>=0.15.0,<2.0.0 ; python_version >= '3.0' and python_version < '3.6'", "werkzeug>=2.0.0,<3.0.0 ; python_version >= '3.6' and python_version < '3.11'", From a1acbf3a53e5f5b122614718acbdc6a7196921a9 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 13 May 2025 10:51:11 +0000 Subject: [PATCH 224/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2936c9a18..607b465c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2025-05-13] Version 6.12.2 +--------------------------- +**Library - Chore** +- [PR #1102](https://github.com/sendgrid/sendgrid-python/pull/1102): update ecdsa in setup.py. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + + [2025-05-13] Version 6.12.1 --------------------------- **Library - Fix** From 3f25a2a6ed33878e13cfe8d76d283b1d6c7b380a Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 13 May 2025 10:51:12 +0000 Subject: [PATCH 225/237] Release 6.12.2 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 431e91f2e..67234a38e 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.12.1' +__version__ = '6.12.2' From a78bd11b854ab38978f73c7e3fda98110bd9f840 Mon Sep 17 00:00:00 2001 From: Elad Kalif <45845474+eladkal@users.noreply.github.com> Date: Wed, 14 May 2025 11:02:30 +0300 Subject: [PATCH 226/237] chore: Relax werkzeug version (#1103) --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b3a8e5c86..a1b1a9743 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,11 @@ def getRequires(): 'ecdsa>=0.19.1,<1', "werkzeug>=0.11.15,<1.0.0 ; python_version < '3.0'", "werkzeug>=0.15.0,<2.0.0 ; python_version >= '3.0' and python_version < '3.6'", - "werkzeug>=2.0.0,<3.0.0 ; python_version >= '3.6' and python_version < '3.11'", - "werkzeug>=3.0.0 ; python_version >= '3.11'" + "werkzeug>=0.15.0,<2.3.0 ; python_version >= '3.0' and python_version < '3.7'", + "werkzeug>=0.16.0,<3.1.0 ; python_version >= '3.0' and python_version < '3.8'", + "werkzeug>=1.0.0 ; python_version >= '3.9'", + "werkzeug>=2.2.0 ; python_version >= '3.11'", + "werkzeug>=2.3.5 ; python_version >= '3.12'" ] return deps From 4671192ce266f575eca28c062766ff4194d66ae9 Mon Sep 17 00:00:00 2001 From: Elad Kalif <45845474+eladkal@users.noreply.github.com> Date: Wed, 14 May 2025 17:35:46 +0300 Subject: [PATCH 227/237] chore: fix werkzeug lower versions (#1104) --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a1b1a9743..745edea81 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ def getRequires(): 'python_http_client>=3.2.1', 'ecdsa>=0.19.1,<1', "werkzeug>=0.11.15,<1.0.0 ; python_version < '3.0'", - "werkzeug>=0.15.0,<2.0.0 ; python_version >= '3.0' and python_version < '3.6'", - "werkzeug>=0.15.0,<2.3.0 ; python_version >= '3.0' and python_version < '3.7'", - "werkzeug>=0.16.0,<3.1.0 ; python_version >= '3.0' and python_version < '3.8'", + "werkzeug>=0.15.0,<2.0.0 ; python_version >= '3.0' and python_version < '3.7'", + "werkzeug>=0.15.0,<2.3.0 ; python_version >= '3.0' and python_version < '3.8'", # version 2.3.0 dropped support for Python 3.7 + "werkzeug>=0.16.0,<3.1.0 ; python_version >= '3.0' and python_version < '3.9'", # version 3.1.0 dropped support for Python 3.8 "werkzeug>=1.0.0 ; python_version >= '3.9'", "werkzeug>=2.2.0 ; python_version >= '3.11'", "werkzeug>=2.3.5 ; python_version >= '3.12'" From 3e9d4efac5d652de81fb82ae38d256aad78c00d5 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 23 May 2025 11:51:29 +0530 Subject: [PATCH 228/237] chore: export EventWebhookHeader (#1107) --- sendgrid/helpers/eventwebhook/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py index d97604df8..82a2cd6b8 100644 --- a/sendgrid/helpers/eventwebhook/__init__.py +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -2,6 +2,7 @@ from ecdsa.util import sigdecode_der import base64 import hashlib +from .eventwebhook_header import EventWebhookHeader class EventWebhook: """ From a24ab9de13b2b182985860e5979b1368d2e9fa95 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 29 May 2025 12:11:32 +0000 Subject: [PATCH 229/237] [Librarian] Version Bump --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 607b465c5..7a69e3f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Change Log All notable changes to this project will be documented in this file. +[2025-05-29] Version 6.12.3 +--------------------------- +**Library - Chore** +- [PR #1107](https://github.com/sendgrid/sendgrid-python/pull/1107): export EventWebhookHeader. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #1104](https://github.com/sendgrid/sendgrid-python/pull/1104): fix werkzeug lower versions. Thanks to [@eladkal](https://github.com/eladkal)! +- [PR #1103](https://github.com/sendgrid/sendgrid-python/pull/1103): Relax werkzeug version. Thanks to [@eladkal](https://github.com/eladkal)! + + [2025-05-13] Version 6.12.2 --------------------------- **Library - Chore** From 159f5dd2d4a6eb360ca61356b009b37fcc6aa5c8 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 29 May 2025 12:11:32 +0000 Subject: [PATCH 230/237] Release 6.12.3 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 67234a38e..67ae80f96 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.12.2' +__version__ = '6.12.3' From f5bf6153b5dabf6fe307a8acdb0e59ce17a0c07a Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Mon, 2 Jun 2025 16:40:55 +0530 Subject: [PATCH 231/237] chore: bug-fix (#1109) --- sendgrid/helpers/mail/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/mail/mail.py b/sendgrid/helpers/mail/mail.py index 2472ad7d3..e475fe764 100644 --- a/sendgrid/helpers/mail/mail.py +++ b/sendgrid/helpers/mail/mail.py @@ -567,7 +567,7 @@ def add_custom_arg(self, custom_arg): :param value: A CustomArg object or a dict of custom arg key/values :type value: CustomArg, dict """ - if custom_arg.personalization is not None: + if not isinstance(custom_arg, dict) and custom_arg.personalization is not None: try: personalization = \ self._personalizations[custom_arg.personalization] From 59994bfafc59fbe7fa2bb9338654e5e6a4e4f612 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 12 Jun 2025 10:27:17 +0000 Subject: [PATCH 232/237] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a69e3f92..87dde6650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +[2025-06-12] Version 6.12.4 +--------------------------- +**Library - Chore** +- [PR #1109](https://github.com/sendgrid/sendgrid-python/pull/1109): bug-fix. Thanks to [@manisha1997](https://github.com/manisha1997)! + + [2025-05-29] Version 6.12.3 --------------------------- **Library - Chore** From 7eafe1854f42ef2d6863a7288c1c2e73f9aa5c82 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 12 Jun 2025 10:27:18 +0000 Subject: [PATCH 233/237] Release 6.12.4 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 67ae80f96..127e2ed69 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.12.3' +__version__ = '6.12.4' From af2c4e70b338cdf4ccca4ed12184fdda5926dcc6 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 11 Sep 2025 13:20:25 +0530 Subject: [PATCH 234/237] chore: use make-test instead of make test-docker (#1117) --- .github/workflows/test-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 959970d94..98bbeefbd 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -37,7 +37,7 @@ jobs: sudo apt-get install -y docker-compose - name: Build & Test - run: make test-docker version=${{ matrix.python-version }} + run: make test deploy: name: Deploy From 68288529c5e510e6fe535c42d7e52fea5922558a Mon Sep 17 00:00:00 2001 From: David Acevedo Date: Thu, 11 Sep 2025 02:57:07 -0500 Subject: [PATCH 235/237] fix: #1108 - Replace ecdsa with cryptography (#1114) Co-authored-by: Shubham --- CONTRIBUTING.md | 2 +- README.md | 2 +- README.rst | 4 ++-- requirements.txt | 2 +- sendgrid/helpers/eventwebhook/__init__.py | 21 +++++++++++---------- setup.py | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 890641059..af9507154 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ We welcome direct contributions to the sendgrid-python code base. Thank you! - Python version 2.7, 3.5, 3.6, 3.7, or 3.8 - [python_http_client](https://github.com/sendgrid/python-http-client) -- [ecdsa_python](https://github.com/starkbank/ecdsa-python) +- [cryptography](https://github.com/pyca/cryptography) - [pyenv](https://github.com/yyuu/pyenv) - [tox](https://pypi.python.org/pypi/tox) diff --git a/README.md b/README.md index 663d1e977..b1b36686f 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ pip install sendgrid ## Dependencies - [Python-HTTP-Client](https://github.com/sendgrid/python-http-client) -- [ECDSA-Python](https://github.com/starkbank/ecdsa-python) +- [Cryptography](https://github.com/pyca/cryptography) diff --git a/README.rst b/README.rst index e23e2300e..526c4ca40 100644 --- a/README.rst +++ b/README.rst @@ -90,7 +90,7 @@ Dependencies ------------ - `Python-HTTP-Client`_ -- `ECDSA-Python`_ +- `Cryptography`_ Quick Start =========== @@ -259,7 +259,7 @@ License .. _Twilio account: https://www.twilio.com/try-twilio?source=sendgrid-python .. _SENDGRID_API_KEY: https://app.sendgrid.com/settings/api_keys .. _Python-HTTP-Client: https://github.com/sendgrid/python-http-client -.. _ECDSA-Python: https://github.com/starkbank/ecdsa-python +.. _Cryptography: https://github.com/pyca/cryptography .. _/mail/send Helper: https://github.com/sendgrid/sendgrid-python/tree/HEAD/sendgrid/helpers/mail .. _personalization object: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html .. _Fluent Interface: https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/ diff --git a/requirements.txt b/requirements.txt index c95204480..ed2594a90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ Flask==3.1.0 PyYAML>=4.2b1 python-http-client>=3.2.1 six==1.17.0 -ecdsa>=0.19.1,<1 +cryptography>=45.0.6 more-itertools==5.0.0 diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py index 82a2cd6b8..9d618bf3a 100644 --- a/sendgrid/helpers/eventwebhook/__init__.py +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -1,7 +1,8 @@ -from ecdsa import VerifyingKey, BadSignatureError -from ecdsa.util import sigdecode_der +from cryptography.exceptions import InvalidSignature +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.primitives.serialization import load_pem_public_key import base64 -import hashlib from .eventwebhook_header import EventWebhookHeader class EventWebhook: @@ -20,15 +21,15 @@ def __init__(self, public_key=None): def convert_public_key_to_ecdsa(self, public_key): """ - Convert the public key string to a VerifyingKey object. + Convert the public key string to an EllipticCurvePublicKey object. :param public_key: verification key under Mail Settings :type public_key string - :return: VerifyingKey object using the ECDSA algorithm - :rtype VerifyingKey + :return: An EllipticCurvePublicKey object using the ECDSA algorithm + :rtype cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey """ pem_key = "-----BEGIN PUBLIC KEY-----\n" + public_key + "\n-----END PUBLIC KEY-----" - return VerifyingKey.from_pem(pem_key) + return load_pem_public_key(pem_key.encode("utf-8")) def verify_signature(self, payload, signature, timestamp, public_key=None): """ @@ -41,7 +42,7 @@ def verify_signature(self, payload, signature, timestamp, public_key=None): :param timestamp: value obtained from the 'X-Twilio-Email-Event-Webhook-Timestamp' header :type timestamp: string :param public_key: elliptic curve public key - :type public_key: VerifyingKey + :type public_key: cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey :return: true or false if signature is valid """ timestamped_payload = (timestamp + payload).encode('utf-8') @@ -49,7 +50,7 @@ def verify_signature(self, payload, signature, timestamp, public_key=None): key = public_key or self.public_key try: - key.verify(decoded_signature, timestamped_payload, hashfunc=hashlib.sha256, sigdecode=sigdecode_der) + key.verify(decoded_signature, timestamped_payload, ec.ECDSA(hashes.SHA256())) return True - except BadSignatureError: + except InvalidSignature: return False diff --git a/setup.py b/setup.py index 745edea81..904cd654a 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ def getRequires(): deps = [ 'python_http_client>=3.2.1', - 'ecdsa>=0.19.1,<1', + 'cryptography>=45.0.6', "werkzeug>=0.11.15,<1.0.0 ; python_version < '3.0'", "werkzeug>=0.15.0,<2.0.0 ; python_version >= '3.0' and python_version < '3.7'", "werkzeug>=0.15.0,<2.3.0 ; python_version >= '3.0' and python_version < '3.8'", # version 2.3.0 dropped support for Python 3.7 From 5e26ead73a8d908550b4fab3166ab41697030c9c Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Fri, 19 Sep 2025 11:47:28 +0530 Subject: [PATCH 236/237] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87dde6650..67d327649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. +[2025-09-19] Version 6.12.5 +--------------------------- +**Library - Fix** +- [PR #1114](https://github.com/sendgrid/sendgrid-python/pull/1114): #1108 - Replace ecdsa with cryptography. Thanks to [@dacevedo12](https://github.com/dacevedo12)! + +**Library - Chore** +- [PR #1117](https://github.com/sendgrid/sendgrid-python/pull/1117): use make-test instead of make test-docker. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + + [2025-06-12] Version 6.12.4 --------------------------- **Library - Chore** From 76788e70a76b11ce2990821f190e52f887ab9ed6 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Fri, 19 Sep 2025 11:48:40 +0530 Subject: [PATCH 237/237] Release 6.12.5 --- sendgrid/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/version.py b/sendgrid/version.py index 127e2ed69..c1d623f90 100644 --- a/sendgrid/version.py +++ b/sendgrid/version.py @@ -1 +1 @@ -__version__ = '6.12.4' +__version__ = '6.12.5'