Remind your users about scheduled appointments with Amazon Alexa and WordPress
Tags: convoworks, alexa, wordpress
Published: 2022-02-17 15:49:13

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 <a href="https://developer.amazon.com/en-US/docs/alexa/smapi/alexa-reminders-api-reference.html">Reminders API</a> 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 <strong>Reminder</strong> <strong>elements</strong>. You can find five elements in our <span class="code">convo-alexa</span> package to help you handle creating, loading, updating, and deleting reminders.

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

<h3>Alexa Reminders</h3>
<strong>Alexa Reminders API</strong> is a set of <span>RESTful APIs that enable developers</span> 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 <strong>Schedule Appointments</strong> 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 <strong>Reminders API</strong> 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 <strong>Reminders API</strong> options.


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

<a class="download-now" style="width: 300px; text-align: center; display: inline;" title="Schedule Appointments - With Reminders - Service definition" href="https://convoworks.com/wp-content/uploads/2022/02/schedule-appointment-reminders.json" download="">Service definition</a>

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

If you are first time using Convoworks you might want to check out our <a href="https://youtu.be/7lx5_ZqazvA">Connect to Amazon and create your first Alexa skill</a> tutorial from <a href="https://youtube.com/playlist?list=PL9eUOVS2fICHc7FF48opQyOWUDVvNoNFD">Convoworks Basics</a> 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 <strong>Alexa mobile app</strong> or real <strong>Echo device</strong>. 


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

<h3>Schedule Appointments with Reminders - Service walkthrough</h3>

This will not be a walkthrough of the whole <strong>Schedule Appointments</strong> template and an explanation of its inner workings. You can visit the <a href="https://convoworks.com/appointment-scheduling-on-your-wordpress-website-now-with-amazon-alexa-skill/">Appointment scheduling on your WordPress</a> blog post for that.

In this section, we'll take a look only at the added <strong>Reminders</strong> flow. As mentioned before, in the case of the <strong>Schedule Appointments</strong> 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.

<img class="wp-image-3456 size-full aligncenter" src="https://convoworks.com/wp-content/uploads/2022/02/7-days.png" alt="Ask for reminding no more than once per week " width="622" height="655" />

<span>Moreover, the user won't be asked for another reminder for seven days after they declined. This is in accordance with the <a href="https://developer.amazon.com/en-US/docs/alexa/smapi/alexa-reminders-guidelines-for-usage.html">Alexa Reminders Guidelines</a>.</span>

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

<img class="wp-image-3457 size-full aligncenter" src="https://convoworks.com/wp-content/uploads/2022/02/create-reminder.png" alt="" width="569" height="369" />

If this is a first-time user, or the user hasn't reclined remainders in the last seven days we can proceed to the <strong>Create reminder</strong> 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.

<img class="alignnone wp-image-3458 size-full" src="https://convoworks.com/wp-content/uploads/2022/02/reminder-time.png" alt="" width="987" height="801" />You can modify the reminder time on the <strong>Variables</strong> 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 <strong>Get reminder time and text</strong> fragment.

<span><img class="aligncenter wp-image-3468 size-full" src="https://convoworks.com/wp-content/uploads/2022/02/reminder-time-and-text.png" alt="Setting Alexa reminder time and text" width="658" height="523" /> </span>

In the same fragment is the <span class="code">reminder_text</span> variable which you can modify as well. This is the text that will be read out to the user during the reminder delivery.

<img class="aligncenter wp-image-3461 size-full" src="https://convoworks.com/wp-content/uploads/2022/02/reminders-missing.png" alt="Alexa reminders not granted" width="611" height="644" />

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



<h3>Conclusion</h3>

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.