Comments (5)
Here's the sendgrid docs that I ended up looking at: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/send_a_single_email_to_a_single_recipient.md
from 100daysofweb-with-python-course.
Thanks @shutteritch I will look tomorrow.
from 100daysofweb-with-python-course.
Ah seems @hobojoe1848's lesson actually. I see he pinned it to sendgrid==5.6.0
, are you using that version or 6.x?
We upgraded back in December on the platform and struggled with some breaking changes in 6.1.0.
Looking at our changes then:
-sendgrid==5.6.0
+sendgrid==6.1.0
...
-sg = sendgrid.SendGridAPIClient(apikey=config('SENDGRID_API_KEY'))
+sg = sendgrid.SendGridAPIClient(api_key=config('SENDGRID_API_KEY'))
...
- mail = Mail(from_email, subject, to_email, content)
+ mail = Mail(from_email, to_email, subject, content)
...
+ message = Mail(
+ from_email=from_email,
+ to_emails=to_email,
+ subject=subject,
+ plain_text_content=body if not html else None,
+ html_content=body if html else None
+ )
...
+ response = sg.send(message)
(before)
sg.client.mail.send.post(request_body=mail.get())
So yeah I think it would be useful to include a script for sendgrid 6.x as that is the default now.
from 100daysofweb-with-python-course.
@shutteritch we can include one, but as you seem to have one ready, you could also contribute by opening a PR against this repo. Thanks
from 100daysofweb-with-python-course.
Seems this was fixed via PR.
from 100daysofweb-with-python-course.
Related Issues (20)
- Day 53 - 56: Django registration_form.html possibly missing action HOT 4
- Day 89 - 92 Deployment Suggestion: Add reference to the Let's Encrypt script in other Webinar? HOT 1
- Days 5-8: Recreate Google's homepage HOT 1
- Days 09-12 Building APIs with Api Star (0.5.x) HOT 1
- Day 69-72 Django Rest Framework Swagger error HOT 3
- Days 9-12 - update Api Star documentation links HOT 3
- Days 9-12 API Method: PUT Issue HOT 6
- Days 93-100: @api.route ↑↑ shifts HOT 1
- Question: double forward underscores HOT 1
- Days 37-40: Intro to Pyramid: Adding the data models HOT 5
- check / update default sendgrid config HOT 2
- Day 22. Installing requirements incompatible chardet HOT 10
- Day 41 Example Tips Page changed HOT 1
- Day 24 - does not work with Flask 2.x HOT 3
- Days 33-36: broken link HOT 1
- Days 045-048 Build a simple Django app [v20/22] missing messages HOT 2
- This is my reference HOT 2
- Day 9 -12: API Star -- Werkzeug Version 3.00 + is not compatible with API Star 0.5.41 HOT 3
- Python
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 100daysofweb-with-python-course.