Python-powered chat apps with Twilio and SendGrid Transcripts
Chapter: Course conclusion and review
Lecture: Review: Send a message to WhatsApp
Login or purchase this course to watch this video and the rest of the course contents.
0:00 Once we fulfilled the cake order and everything was ready to pick it up. The way we wanted to let our users know was we sent them a message back
0:08 to the same place they started this conversation, which was through WhatsApp. This was a little bit different,
0:13 though, Instead of responding to some kind of inbound message, which is what happens at Twilio studio with our flow, we're going to initiate a message,
0:21 so we're going to just simply specify our from number. This would be your business number or something like that. But here, this is the sandbox number.
0:30 The to number is whatever they initiated their call from so ordered.user.phone
0:35 and we give them some message like your cakes order status code is ready for pickup
0:39 create a rest_client set the id set the password again coming from our secrets and we just say client messages create body, to, from.
0:50 Of It goes long as there's no erro message, things are good. One thing to keep in mind is if this is outside the
0:55 24 hour interaction window, which in this case it probably is you're going to need
1:00 to make sure that you're using one of these rebuilt couple of templates that you can use. See the URL, the bottom. You can learn more about that.
1:06 And then when you get this set up for real, you're going to need to get the message template approved at WhatsApp,
1:12 so that then you can send that we'll be sure to use the right message template to make sure that this will go through for them and doesn't get blocked.
1:19 That's it. Now our user has gone round tripped. They've started the cake conversation with us. We told him what we had.
1:26 They filled out all the information, requested the cake, we got it over and flask. The admin API showed it to the Bakers.
1:32 They baked it. And now we send them the message and they come and pick up the cake. Fantastic app we built here, isn't it?.