DEV Community

Cover image for Remind your users about scheduled appointments with Amazon Alexa and WordPress
Tihomir Dmitrović
Tihomir Dmitrović

Posted on • Originally published at convoworks.com

Remind your users about scheduled appointments with Amazon Alexa and WordPress

Alexa's reminders feature lets users receive a "barge-in" notification at a predetermined time. Alexa delivers the reminder by chiming and reading out the reminder message.

By integrating Alexa's Reminders API in your skill you can increase the engagement of your skill and extend utility beyond users having to launch the skill to get the most out of its features. Integrating reminders has never been easier with the help of Convoworks Reminder elements. You can find five elements in our convo-alexa package to help you handle creating, loading, updating, and deleting reminders.

In this post, we'll go over the Reminders basics and how we implemented them with our Schedule Appointments template.

Alexa Reminders

Alexa Reminders API is a set of RESTful APIs that enable developers to create and manage reminders for users as part of the skill experience. The user needs to grant permission for reminders, both when enabling a skill and in-skill before each reminder is set. If push notification is enabled, the reminder will be sent as a push notification on the Alexa mobile app as well.

The skill can create a one-time or a recurring reminder. If a reminder is recurring, it can be set to occur either weekly or on specific days. In the case of the Schedule Appointments reminders integration, we'll be setting a one-time reminder, an hour before the appointment starts. But, more on that later on, in the walkthrough section.

Developers can use the Reminders API in two ways: for in-session interactions and out-of-session interactions. Out-of-session interactions don't require users to interact directly with a skill. The user can delete, update and read reminders out-of-session, however they cannot create one. The in-session interaction allows the creation, updating, deleting, and reading of reminders while the user interacts with a skill.

In Convoworks, we have created five specific elements to handle those interactions and cover all Reminders API options.

Set up Schedule Appointments template with Reminders

We have already created an updated version of our Schedule Appointments template that lets you take advantage of reminders. Just follow these simple steps to set up the service and get it going.

Service definition

Navigate to Add new service view in Convoworks WP and select Import from file option. Upload the service definition from the link above. Navigate to the Configuration view and publish it to Amazon.

If you are first time using Convoworks you might want to check out our Connect to Amazon and create your first Alexa skill tutorial from Convoworks Basics video series.

Lastly, after the changes have taken effect, you can test the service to make sure it's good to go. As reminders are a specific feature, the skill can be tested either in Alexa mobile app or real Echo device.

Now, let's take a look under the hood.

Schedule Appointments with Reminders - Service walkthrough

This will not be a walkthrough of the whole Schedule Appointments template and an explanation of its inner workings. You can visit the Appointment scheduling on your WordPress blog post for that.

In this section, we'll take a look only at the added Reminders flow. As mentioned before, in the case of the Schedule Appointments reminders integration, we've added a one-time reminder option, an hour before the appointment starts. The user is free to decline a reminder, and it won't be set.

Ask for reminding no more than once per week

Moreover, the user won't be asked for another reminder for seven days after they declined. This is in accordance with the Alexa Reminders Guidelines.

Before the user is asked if they want a reminder in the Schedule Appointment block, the service checks if seven days have passed since the last time the user had said no to the reminder.

If this is a first-time user, or the user hasn't reclined remainders in the last seven days we can proceed to the Create reminder block, where the user is asked if they want a reminder one hour before the appointment. We decided to use a predefined reminder to make conversation more convenient.

You can modify the reminder time on the Variables Convoworks view. Given how the service is set up currently, the time of the reminder can be only on the day of the appointment and is calculated as the time before the appointment in the Get reminder time and text fragment.

Setting Alexa reminder time and text

In the same fragment is the reminder_text variable which you can modify as well. This is the text that will be read out to the user during the reminder delivery.

Alexa reminders not granted

Before creating an actual reminder, we have to check if the user granted the reminder permission. If the permission has been granted the Create Alexa Reminder Element creates the reminder with the inputted data.

Conclusion

In this post, we went over the example of using reminders in the appointment booking scenarios. Reminders are a useful tool for increasing the engagement of your skill and extending its utility and hopefully, you can use this example as a starting point on your integrating reminders into skills journey.

Top comments (0)