Python-powered chat apps with Twilio and SendGrid Course

6.2 hours, 100% free
Take this course for FREE
This course is carbon neutral.

Course Summary

Twilio is a platform that enables you to build applications that integrate with text/SMS messages as well as other channels such as WhatsApp and voice calls. In this course, we will build a production-grade Flask application with Python 3 that adds deep integration with a customer service and ordering bot using Twilio's WhatsApp features. Additionally, we'll add SendGrid outbound email support to send our customers PDF and well-design HTML messages.

Source code and course GitHub repository

github.com/talkpython/twilio-and-sendgrid-python-course

What's this course about and how is it different?

Many courses will show you a quick how-to with Twilio. In this free course, we will build a complete, end-to-end Flask web application with modern Python tools. You will learn exactly what is needed to truly integrate text/chat with Python. We'll sketch out the workflow in Twilio Studio and then create a series of HTTP/ JSON APIs in Flask that perform key integration.

We will add text-intiated ordering for a hypothetical bakery called "Cloud City Cake Company". Over at the Cloud City website, we'll have a quick way to kick off a chat conversation in WhatsApp, hook important stages of that conversation with our Flask APIs, send rich emails and generate PDFs in Python.

Our customers will receive an email invoice as well an unprompted text message when their cake is ready for pickup. At the same time, this integration will communicate with our bakers about what cakes have been ordered and they can indicate when the cakes are finished.

What we'll build

Here is a visual summary of just some of what you'll build during this course:

  • A Twilio chat interaction over WhatsApp with validation and API integration
  • Rich email response over SendGrid with formatted HTML, images, and attached generated PDF
  • A Flask admin backend to recieve the orders and notify users over chat their order is ready

What topics are covered

In this course, you will:

  • Learn how to build chat workflows in Twilio Studio
  • Integrate HTTP APIs (external and ours) with Twilio
  • Create a realistic Flask application
  • Validate chat responses and direct the workflow accordingly
  • Define HTTP JSON based endpoints for APIs with Flask
  • Use Pydantic for declarative data exchange, validation, and conversion with Flask
  • Define SQLAlchemy ORM classes to save data to a database
  • Query and update data with SQLALchemy ORMs classes
  • Send email using Python and SendGrid
  • Generate a rich PDB using Jinja2 templates in Python
  • Add attachments to outbound email
  • Send an unprompted text message to a user over WhatsApp with Twilio's Python API
  • And lots more

View the full course outline.

Who is this course for?

This course is for anyone who wants to build Twilio chat applications with Python as the backend language. The student requirements are quite light for this course. You'll need Basic Python language knowledge:

  • Basic Python language experience
  • Understanding of web applications (we'll talk through the Flask details)

Note: All Twilio and SendGrid services used in this course are based on free trial accounts. You won't have to subscribe to anything.

Concepts backed by concise visuals

While exploring a topic interactively with demos and live code is very engaging, it can mean losing the forest for the trees. That's why when we hit a new topic, we stop and discuss it with concise and clear visuals.

Here's an example of calling out the API for sending an outbound WhatsApp message with the Python Twilio library.

Example: Concepts backed by concise visuals

This course is delivered in very high resolution

This course is delivered in 1440p (4x the pixel count compared to 720p). That means when you are watching the videos for this course, it looks like you are really sitting next to the instructor looking at their screen.

Every little detail, menu item, and icon is clear and crisp. You can watch the introductory video at the top of this page to see an example.

Follow along with subtitles and transcripts

Each course comes with subtitles and full transcripts. The transcripts are available as a separate searchable page for each lecture. They also are available in course-wide search results to help you find just the right lecture.

Each course has subtitles available in the video player.

Who am I? Why should you take my course?

Who is Michael Kennedy?

My name is Michael, nice to meet you. ;) There are a couple of reasons I'm especially qualified to teach you Python.

 1. I'm the host of the #1 podcast on Python called Talk Python To Me. Over there, I've interviewed many of the leaders and creators in the Python community. I bring that perspective to all the courses I create.

 2. I've been a professional software trainer for over 10 years. I have taught literally thousands of professional developers in hundreds of courses throughout the world.

 3. Students have loved my courses. Here are just a few quotes from past students of mine.

"Michael is super knowledgeable, loves his craft, and he conveys it all well. I would highly recommend his training class anytime." - Robert F.
"Michael is simply an outstanding instructor." - Kevin R.
"Michael was an encyclopedia for the deep inner workings of Python. Very impressive." - Neal L.

Free office hours keep you from getting stuck

One of the challenges of self-paced online learning is getting stuck. It can be hard to get the help you need to get unstuck.

That's why at Talk Python Training, we offer live, online office hours. You drop in and join a group of fellow students to chat about your course progress and see solutions via screen sharing.

Just visit your account page to see the upcoming office hour schedule.

The time to act is now

Meet your customers where they are. Text messaging is one of the highest open-rate channels and a great way for you to communicate with your users. Twilio is the leader in programmable messaging and Python one of the hottest and easiest languages out there. Put them all together with this free course. Join today.

Best of all, this course if 100% free, so give it a try. There's nothing to lose.

Course Outline: Chapters and Lectures

7:05
2:01
3:01
1:22
0:41
6:02
2:10
1:41
1:17
0:54
59:31
1:33
4:43
3:19
2:13
3:20
4:26
2:14
2:15
8:03
1:41
4:02
4:56
3:01
5:28
1:28
4:07
2:42
44:43
0:41
6:02
6:21
3:05
3:20
2:39
3:23
1:59
4:34
3:33
7:32
1:34
53:45
1:06
0:57
3:13
1:31
6:00
2:03
3:27
5:00
4:51
9:11
2:39
2:39
3:30
1:30
2:30
3:38
23:25
0:42
2:56
5:35
6:13
5:52
2:07
45:54
1:00
1:42
4:09
4:02
6:03
6:39
4:22
4:45
2:33
1:23
2:00
3:20
1:17
2:39
14:15
0:31
2:04
4:03
1:40
4:13
1:44
11:32
0:34
0:36
1:36
1:18
1:39
1:13
0:36
1:34
1:39
0:26
0:21
54:50
4:07
1:35
2:14
3:10
8:31
1:51
6:01
6:26
5:00
4:24
7:16
4:15
52:56
2:18
1:36
1:33
3:36
2:34
1:20
5:09
2:22
5:55
9:03
9:18
4:03
0:44
0:49
1:59
0:37
Take this course for FREE