Python-powered Chat Apps with Twilio and SendGrid Transcripts
Chapter: Sending outbound text messages
Lecture: The final notification: Your cake is ready

Login or purchase this course to watch this video and the rest of the course contents.
0:00 One more thing to do to our app. One more chapter. So one more copy of our code here.
0:07 Go ahead and fire this up. It's obviously what we just finished with from Chapter 7 and here in our Cloud City Cake company.
0:15 Remember, we have our admin section, and when it's finished what we tell the people to expect,
0:21 we told them to expect to get a message telling them that their cake was ready that it was completed. Well,
0:28 if we push this button, it goes to the database and it marks it fulfilled and refreshes this page like we learned did in our admin section.
0:37 But there is no text message to be found in our WhatsApp, but that's what we're going to do in this chapter.
0:43 We're going to build out this button to actually send the notification back through WhatsApp. to the user. And if we go look at the code,
0:51 the part that is relevant is the second part. The fulfill part. And it says to do send a WhatsApp message to notify your
0:59 customers. So let's get this started by saying, How did we send over here real quick? How do we send email we used our email service.
1:06 How do we work with our users? We use the user service. So we're going to have a WhatsApp service. I'll say, send_order_ready or send_cake_ready.
1:17 How about that? And what we can pass along here is just the order that we got. Neither of these exist, So let's go make that happen.
1:30 We're gonna need to import this now that it exists. And then let's write that function. Thank you. PyCharm is going to be in order out of the database.
1:41 Perfect. So what we're going to need to do is do a little bit of work with the WhatsApp, API here which turns out to be quite simple
1:48 to use, actually simpler than sending email. To be honest, we use the twilio WhatsApp API, to send this message over.
1:57 So really, all we have left to do to finish our entire application is to write this one function. That's pretty awesome.


Talk Python's Mastodon Michael Kennedy's Mastodon