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.
0:03
The way we wanted to let our users know was we sent them a message back
0:07
to the same place they started this conversation,
0:09
which was through WhatsApp. This was a little bit different,
0:12
though, Instead of responding to some kind of inbound message,
0:15
which is what happens at Twilio studio with our flow,
0:18
we're going to initiate a message,
0:20
so we're going to just simply specify our from number.
0:24
This would be your business number or something like that.
0:27
But here, this is the sandbox number.
0:29
The to number is whatever they initiated their call from so ordered.user.phone
0:34
and we give them some message like your cakes order status code is ready for pickup
0:38
create a rest_client set the id set the password again coming from our secrets
0:44
and we just say client messages create body, to, from.
0:49
Of It goes long as there's no erro message,
0:51
things are good. One thing to keep in mind is if this is outside the
0:54
24 hour interaction window, which in this case it probably is you're going to need
0:59
to make sure that you're using one of these rebuilt couple of templates that you can
1:03
use. See the URL, the bottom.
1:04
You can learn more about that.
1:05
And then when you get this set up for real,
1:08
you're going to need to get the message template approved at WhatsApp,
1:11
so that then you can send that we'll be sure to use the right message template
1:15
to make sure that this will go through for them and doesn't get blocked.
1:18
That's it. Now our user has gone round tripped.
1:21
They've started the cake conversation with us.
1:23
We told him what we had.
1:25
They filled out all the information,
1:26
requested the cake, we got it over and flask.
1:29
The admin API showed it to the Bakers.
1:31
They baked it. And now we send them the message and they come and pick
1:35
up the cake. Fantastic app we built here, isn't it?.