DEV Community

Cover image for Appointment scheduling on your WordPress website - Now with Amazon Alexa skill
Tihomir Dmitrović
Tihomir Dmitrović

Posted on • Updated on • Originally published at convoworks.com

Appointment scheduling on your WordPress website - Now with Amazon Alexa skill

Many of the WordPress based websites have some kind of appointment scheduling functionality. To be more precise, there are a dozen most popular plugins which are powering at least 150K websites. Hairdresser salons, dentists, online events, there are many use cases which require booking functionality. Wouldn't it be great to be able to offer your customers the same functionality via smart speakers (e.g. Amazon Alexa)?

Voice assistants are in constant rise and are proving themselves as the user interface that you will not be able to avoid in the future. Right now, developing voice apps seems reserved for the enterprise market only, primarily because of high development costs, but in the WordPress world it can be easily changed. That is exactly what we have done and you can have your appointment booking Alexa skill in no time, for free.

Appointment booking plugins compatibility

As each appointment scheduling plugin has its own functions, database structure, ... you must be wondering how we plan to overcome that issue. As we can not completely solve it, we designed our solution in such a manner that it consists of two parts.

The first is our convo-appointments package, generic appointment booking solution, not tied to any plugin, not even to WordPress. This part is focused on solving conversation design requirements, while the real data (load, create ...) is delegated to the appointments context component (data source). This package comes with one dummy appointments context implementation that can serve you as an example how to implement it for your own plugin, or just testing the skill workflow. This package also contains a ready to use Alexa skill template. You can find more about this package on the GitHub repository.

The second part is concrete appointments context implementation, which internally calls required plugin functions and does required data transformations. At the moment, we are providing implementation for the Simply Schedule Appointments WordPress plugin and you can find it in convo-wp-plugin-pack components package. In the ideal case, your appointments plugin will already include its own custom package with an appointments context implementation.

In this article, we will explain basic functionality of the skill itself, how to install it on your own installation and if you have Simply Schedule Appointments plugin, how to switch the skill to use it.

If this is your first contact with Convoworks, you might want to first check some basics in our documentation or the Convoworks basics video tutorial series.

"Schedule Appointments" - Alexa skill template overview

The appointments package is shipped with the ready to use Alexa skill template, which functionality will be described in this section. This template is created to be used as Amazon Alexa only and the skill itself requires access to user full name and email address, which can be enabled in the Alexa app during the skill activation.

When we are talking about booking appointments scenarios, we should notice two main conversation flows depending on if the user already has or doesn't have an appointment.

No appointments flow & first time users

During the introduction phase, the user is greeted, told introductory information like business hours, and asked if they want to schedule an appointment.

Opening message in the appointment scheduling conversation

If the first-time user answers in the negative, the service offers the user some info about the skill owner's business, and if that answer is negative as well, it reminds users that they can ask for information about the company anytime and exits.

If the user answers in the affirmative, the service asks about the appointment date, then if not provided along with the date, the appointment time. Finally, the service checks availability. If the date and time are available, the service asks for booking confirmation.

Requesting time slot conversation

If the requested date and time are not available, the user is asked to choose another time slot. In addition, our app is even capable of offering free slot suggestions.

Free appointment slots suggestions

Anytime during the service run, users can ask for help and get help in accordance with the service step they're on. Users are also able to ask Alexa to repeat the last response, by simply saying “Repeat”.

To skip most of the steps, a user can rely on a one-shot request when opening the skill, for example: "Ask Schedule appointment to schedule an appointment on Monday at 9 am". This will send the user, if the date and time are available, right to the confirm step.

Existing appointments flow - returning user

The returning user no appointments flow is similar to the first-time user one. The exception is some changes in the text, omission of tips and introduction, as well as skipping offering to hear more about the company.
Conversation opening message with the existing appointment

The introduction message in existing appointments flow slightly differs depending on if the user has one or more than one appointment. If the user has an upcoming appointment, after the welcome back message, the service informs the user about the one upcoming appointment with the date and time of that appointment. The service then offers the option to cancel or reschedule the appointment.

If the user has asked to cancel the appointment, the service asks for confirmation and if the answer is yes, deletes the appointment and exits. If the answer is no the service exits after a brief message.

Cancel appointment conversation scenario

Alexa skill setup

Here are the instructions on how to enable appointment scheduling as an Alexa skill on your WordPress installation. You have to have installed Convoworks WP properly connected with your Amazon developer account (check Amazon Alexa Configuration Docs or Video tutorials at YouTube). You will start with creating a new service (from template), you will do some basic configuration and push it to the Amazon Alexa skill store.

Create new service from template

We will start with creating a new service from the template - Schedule Appointments which is part of the convo-appointments package.
Create appointment scheduling Amazon Alexa skill from the template

First, open the open Convoworks WP services view and click on the Create new button. Enter your service name, then select the Schedule Appointments template and press the Submit button. Service name will be used as default for your Amazon Alexa skill invocation phrase, so it might be useful to find a nice name for it. Check about choosing the right invocation for your skill here.

Change the app name and other variables

This template is ready to use, but you will probably want to do some modifications to make it better fit for your needs. Besides the appointment scheduling functionality, this template has sections with the company info and about business hours that your customers might be interested in hearing.

Set your Alexa skill name

One thing you will certainly want to change is the APP_NAME variable (Variables view in service editor). This variable is used in several places in the skill (e.g. "Welcome to ${APP_NAME}") and you should change it to fit your chosen name. Another one that you might want to change is MAX_APPOINTMENTS_PER_PERSON which can limit the number of active appointments one user can have. There are also two variables related to formatting date and time values when speaking to the end user. There is no actual need to change this, but you might want to play around to fit your needs in a better way. More about date format options can be found at PHP docs.

Change or remove business hours info

In some cases, like with first time users, the skill will inform users about business hours that are available to him. The related texts are defined in Working days and hours - intro and Working days and hours - not_allowed service fragments. Business hours definition is right now hardcoded in the service definition, so if you need to change it navigate to these two fragments and change the values to the ones which will describe your case.

Business hours information for the appointment scheduling alexa skill

Change or remove About

Your users might be interested in hearing more info about your business. The related text is defined on the Read about us conversation step. Navigate to that step and change the info about your business.

Handling about section in the conversation

To remove the About flow, you'll need to delete the Run once element containing the fragment in the Home block. delete the About block and delete the About processor in the Service processors.

Time zones

When we are talking about appointment scheduling and time zones, there are two main scenarios.

First is when the appointments are in person meetings, like hairdresser salon or dentist visits. So if you are in LA and you are scheduling your visit to the dentist in NY, you will operate in the target time zone (NY). This is the default behavior for our appointment scheduling template.

The second mode is more appropriate for online meetings. In such a case, the user is trying to book time in his own time zone and the system will do required transformations and check the availability correctly.

Our components and the whole system design are supporting both variants and it is achieved with the Timezone mode and Timezone properties on the appointments package related elements. The template is configured to use the Default mode which will use the appointments plugin default timezone (the first case).

If you want to change the time zone mode your service is working with, right now you will have to go through the template and update manually time zone component parameters. In the next release, we will move those two configuration options to the variables, so you will be able to change it from a single place.

Amazon Alexa Configuration

In order to work, we have to publish it to the Amazon Alexa skill store. Navigate to the service configuration view, and select Amazon Alexa.

Deploy Convoworks service to the Amazon Alexa console

This skill requires some user information, so do not forget to select Full Name and Customer Email Address in the Amazon Alexa Skill Permissions panel (see below). If you want to be able to enable a beta test for the skill, you'll have to enter the Privacy Policy URL in the Edit Skill Store Preview section.

Set Amazon Alexa Skill Permissions

After filling in the information and clicking "Save" your service will be propagated to Amazon and you can head on over to the skill's Alexa Skills Kit developer console to test.

Simply Schedule Appointments integration

If you have Simply Schedule Appointments plugin activated on your website, you can switch the service to use it and have full blown appointment scheduling Alexa skill. In this case, while in service editor switch toolbox to packages view and enable convo-wp-plugin-pack package. After you enable it, you will be able to add the Simply Schedule Appointments source under the Contexts tab. Once you add it, enter desired context id and select the Appointment Type you want to handle.

Simply Schedule Appointments WordPress plugin conversational context component

Copy the Context ID and head on over to the Variables panel. Use it to set the APPOINTMENTS variable. Do not forget to save changes.

Configure service to use Simply Schedule Appointments context

That's it. You've created a functional appointment scheduling Amazon Alexa skill using the Simply Schedule Appointments. It is good to know that the appointments created are the same as one created through the web interface. If you installed some additional plugins, to send email notifications or do any other additional functionality, everything will work the same.

Conclusion

There are many plugins which are extending WordPress functionality in many different ways. At the same time, it is a blessing and a curse. With our appointments package we demonstrated how such issues can be avoided in a cheap and efficient way.

If you use some other appointment scheduling plugin, or even better if you are a developer of such one, please contact us and we will be glad to help you with integration.

Discussion (0)