Weekly Notification Bot: Call Your Mom
Walkthrough Level: Beginner
Hey you! Have you called your mom recently? She misses you, you know.
But you're too busy, you say!
Work has been overwhelming and there's this huge project deadline. The boss is totally on you and you're so exhausted by the time you get back home. How will you ever remember to pick up the phone and give your mom a ring?
Luckily for you, Dexter is here to remind you to "Call Your Mom™" with this simple weekly push notification. The bot sends out useful weekly messages at Sunday 7PM EST to remind their users to pick up their phone and dial dear ol' mum.
Keep reading and learn how you can make a bot to help people stay in touch with their loved one. 💕
Exploring the World of Broadcasts
For this tutorial, let's start outside of the comfort zone of the Editor Tab and venture over to the Broadcasts Tab.
It's definitely possible to create a bot on Dexter where you'll never need to send a broadcast. However, consider adding a well-timed broadcast to provide a more enriching bot experience, by enabling the creator to:
- alert their audience to new content within the bot flow,
- re-engage with inactive users,
- send targeted content to specific segments
- build a bot centered around providing utility through regularly scheduled messages.
Call Your Mom Bot is a classic example of this last kind of bot and with the new Repeating Broadcasts functionality, it's as simple as setting up one broadcast!
Baby's First Broadcast
The Broadcasts Tab will look pretty bare the first time you reach it on a new bot. Before you're allowed to even send your first notification out, you'll need to deploy a bot to a platform on the Platforms Tab.
When you've successfully done that, return to the Broadcasts Tab and create a new broadcast by pressing the now-active " + New Broadcast" button.
A new Broadcast canvas should appear, which might look a little something like this (and will definitely look something like this after you've finished this tutorial):
The meat of the broadcast lives in the center panel. For our bot, there are three things we'll need:
- First off, what is the message we'd like to share to our users?
- Second, what segment of our audience would we want to send this message to?
- and lastly, at what time or with what frequency would we like to send this message out?
A Message in a Broadcast
Of course, we can definitely just send a simple text message to our users ("Hey you! Call your mom!"), but let's amp things up a bit and build in a feedback flow to see if the user actually followed through.
By including a
^buttons() shortcode, the user is prompted to respond if they've actually heeded our reminder.
When this message is sent out, the user will receive a message that looks something like this (exactly like this if deployed on Messenger):
The user can then choose to respond "Yes" or "No" from the set of quick reply buttons!
We'll have to do just a tad bit more to our botscript now to have those
^buttons() choices trigger appropriate responses, so for that, let's head back to the Editor Tab.
Yes, No, Maybe So
In the spirit of amping things up, let's also keep track of how often the user has committed to calling their mom in a row! We want to reward good behavior after all. We'll keep track of this in a bot variable called
In its simplest form, the bot script will look something like this:
When a user has pressed "Yes", they will increment their
calls by 1 using the
<add> Rivescript direction. If they've been bad and admitted "No, I have not called my mother", we will reset their
calls variable to 0! Additionally, the bot will attempt to shame them through a gif using the ^image() shortcode. 😳
As always, it's best practice to include a catch-all. Our catch-all here is being used to redirect the user to answer our Yes-No question.
Great, now tap Publish on the Editor tab and we're good to return back to the Broadcasts Tab.
This is simple enough, we want everyone to call their mothers! If you do want to further segment your audience though, read more in the Segmentation section of our Broadcast guide.
Perhaps you'll want to send a special message to users who have a high streak in the number of calls they've made to mum! 💓
Let's get to the core of why we're here. We want to schedule a regular weekly reminder -- also known as a Repeating Broadcast. To do so, scroll to the Timing section and select on a schedule from the "Send broadcast" dropdown.
- From here, we can select when in the future we'd like to start this broadcast.
- I'll choose this upcoming Sunday starting at 7PM.
- Next, we'll choose how often we'll like to repeat this message.
- At the very least, it seems prudent to call at least once a week, so we've selected "Weekly" on Sunday. But hey... why not call her three times a week or every day?
- Lastly, let's decide when we'd like to end this repeating broadcast.
- Let's "never" stop calling mom.
Hit the Schedule button. You're all set!
The only thing left to do now is message your bot "hello". (After all, your bot needs to know that you exist before it can message you!) Then, we wait for a message to come through on Sunday at 7PM to remind us to call our moms.
Alternatively, you should just call your mom now. She misses you, you know.
Learn more about what else you can do with broadcasts by reading more in our broadcast guide.
If you build anything cool using our broadcast functionality, don't hesitate to alert us through live chat or sending over an email!