Python-powered chat apps with Twilio and SendGrid Transcripts
Chapter: Messaging and workflows with Twilio Studio
Lecture: Confirm the price of the cake
Login or purchase this course to watch this video and the rest of the course contents.
0:00 We don't know the price. And we've told them what is going to cost. But what we really need to do is ask. Here's how much it's gonna cost.
0:07 Are you ready to pay for that? But let me just nab this. Copy this message body. So I'm to type it again and get rid of that
0:15 and want to come over here instead of doing a send. We're gonna do like we have been a send and wait for replies also be confirmed
0:22 price. And the message is going to be this. Do you want you place that order, over here? If they say no, we're gonna need to do a test first.
0:37 So let's get our split. We're going to test if they said yes, basically, in some way or another.
0:48 If not, then we're going to send him a message like Sorry, I guess you're not looking for any cake. But if they do confirm yes,
1:00 they want it, then we're going to send a message like, and that's just gonna be a little placeholder while we're working on this.
1:06 So let's say CheckConfirm And what is our variable? It's going to be ConfirmedPrice.inbound.body And if no, there's no match, We're gonna say sorry.
1:24 I guess you don't want cake. But if there is, and I have to determine if there's a match, So what could they type? They might type.
1:31 Yes, but they might just have y type? y they might type. Yeah, they might type, please. They might type.
1:40 Definitely. You can just go through the various things you would be willing to accept
1:45 here, right? We could also loop around and make them say yes or no But I'm just going to keep it. Keep it simple like this. But if it matches this one,
1:56 we're gonna go along here and say, Great. Um, we'll need some info from you to keep going. This one will just say no cake.
2:14 Sorry. You're not having cake with us today. Something along those lines. All right, publish it. I think we are about ready.
2:21 So when I come through and make sure that they say yes. Yeah, Y, please. Definitely something like that. Which case?
2:29 Down the path they go. Please tell me your name, your email and so on. More cake. Feel in rainbow again. How about you guys,
2:38 but small. You have to do this a lot of times. Rainbow don't need to test our error handling. Won't try to not try to not trigger it.
2:47 All right, let's have Sprinkles on our rainbow maple cake or pricing it at the API should have an answer and get a response back.
3:01 Oh no, our order stopped. Actually, there's a really small mistake. Let's go fix it when we price our cake.
3:07 We forgot to make that little connection right there. So when it got to this part, it priced it and then exited.
3:13 Let's try one more time and we're back. Let's get a small, rainbow chocolate Oh, chocolate. Hey! And I think I'll go for Sprinkles again.
3:30 Those sound fun. Perfect. That will cost us 18.5 gold coins. Would you like to place that order? Remember, we could type Y,we could type.
3:39 Yeah, we could type. Definitely. We don't We type something wrong or something that is not confirmation is going to say
3:47 sorry, you're not having cake with us, but let's go ahead and with try. Yeah, great. We'll need some info. That's actually the end of the workflow,
3:56 but this is where we can go and ask questions like All right, tell me your email address. Tell me your name and so on.
4:02 Cool. So it looks like we've got our pricing and our price confirmation integrated.