Giter Site home page Giter Site logo

Comments (5)

shutteritch avatar shutteritch commented on August 18, 2024

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.

bbelderbos avatar bbelderbos commented on August 18, 2024

Thanks @shutteritch I will look tomorrow.

from 100daysofweb-with-python-course.

bbelderbos avatar bbelderbos commented on August 18, 2024

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.

bbelderbos avatar bbelderbos commented on August 18, 2024

@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.

bbelderbos avatar bbelderbos commented on August 18, 2024

Seems this was fixed via PR.

from 100daysofweb-with-python-course.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.