WhatsApp Notifications in the Amelia WordPress Booking Plugin

Along with email and SMS notifications, Amelia allows you to configure and use WhatsApp notifications as well. They use a similar approach, but with a few differences. Let’s dive in.

Please note that WhatsApp integration is only available in Amelia Pro and Amelia Developer License plans.

Video version

Setting up the app on Facebook

Visit this link to log into, or create your Facebook Developer Account. You can use your personal account, or your company’s Facebook account, you just need to log into it.

If you already have a Facebook Developer Account, you can skip the “Account Creation” section below and jump straight to “App Creation” by clicking here.

Account Creation

If you’re creating a new Developer Account, once you access the link above, in the upper right corner, click on “Log In”. Since WhatsApp is now a part of the Meta family, you will be logging into Facebook:

FB-login

Once you do log in, you will be redirected back to the home page of developers.facebook.com. Again, in the upper right corner click on “Get Started”.

The 1st step is Registration, where you need to agree to Facebook’s Terms and Developer Policies:

FB-registration

The 2nd step is the account verification, which can be done either by adding a valid phone number (you will receive a verification code via SMS, so it needs to be a real number you can access), or by adding a credit card to your account.

FB-acc-verification

The next step is to verify that the email linked to your Facebook account is valid. If you need to change it, click on “Update Email” in the lower right corner, and if it’s the correct email address, click on “Confirm Email” to continue to the last step.

FB-email-confirmation

The last step is used for helping Facebook improve your experience with the Facebook for Developers account. You can select “Developer” as we did in the screenshot below, but you can, of course, select another role. When you select it, click on Complete Registration, and that’s it.

FB-description

App Creation

Within the Facebook developer account, you’ll either see a list of your apps (if you already used it) or you’ll see a blank screen as shown in the screenshot below. All you need to do is click on “Create App” either in the top right, next to the search box, or in the App list section.

FB-create-app

Select App type – Since you need to use WhatsApp with your business (regardless if you’re a “One-man show” or an enterprise), you need to select the “Business” type app option, and click the “Next” button in the lower right corner.

FB-app-type

Provide basic information – In here, you only need to choose the display name of your app (you can change this later). The email you’re logged in with is already populated, and the Business Account is not a mandatory option for using WhatsApp within Amelia, so even if your account is linked to a Business Account, you don’t need to select it.

FB-app-details

Facebook doesn’t allow certain terms like “whatsapp”. For example, you may not use Meta’s trademarks or brand elements (including FB, Face, Book, Insta, Gram, and Rift) or any confusingly similar terms in your app name if such term is, or could be perceived as, a reference to Facebook or its brands.

Once you click the “Create app” button, Facebook will ask for your Facebook password. Enter the password and click “Submit” to continue.

This completes the creation of the app, and now we need to add a product to the app (WhatsApp). To do that, scroll down to the end of the page and click on “Set up” in the lower right corner of the “WhatsApp” card:

WhatsApp-Set-up

The next screen informs you what’s included in the Business Platform API and by continuing, you agree to the Facebook Terms for WhatsApp Business and the Meta Hosting Terms for Cloud API. All you need to do is click on “Continue”:

WhatsApp-API-getting-started

The next screen consists of data needed to test the app – a Temporary Access TokenPhone Number ID, WhatsApp Business Account ID, and Curl of sending messages.

Please note: You will need the Phone Number ID and the WhatsApp Business Account ID later when you configure WhatsApp integration in Amelia. To skip to this step, please click here.

App-testing

In the “From” section, you will see a test number assigned to your account (this number cannot be used in production).

In the “To” section, you will see a drop-down menu that will be empty when you expand it. You can click on “Manage phone number list” and add up to 5 phone numbers to receive free test messages.

Please note: WhatsApp will send a confirmation code to the phone number, so you can’t actually add this number until you enter the 5-digit verification code you receive in the WhatsApp account linked to the phone number you provided.

Once you add your personal number for testing, you can click on the blue “Send message” button in the lower right corner under Step 2 and you should receive a WhatsApp message similar to this:

WhatsApp-test-success

After you receive the text message, you can scroll down in the Facebook for Developers page; skip steps 3 and 4 and click on “Add phone number” in the bottom right:

Add-phone-number

This will bring up a modal where you add your business name (this is the name your customers will see on WhatsApp when they receive a message from you), business email (needs to be a valid email, since you’ll need to confirm it), your country, and your business’ website.

When you’re done populating this, click on “Next” in the bottom right corner.

Add-phone-number-modal

The next pop-up will ask for the timezone, business category, and business description. Fill in the details carefully and click the “Next” button in the bottom right corner.

Business-description

Enter your business’ official phone number that will be used for Amelia.

Bear in mind that this can’t be the number that’s already using WhatsApp, so it has to be a number that’s new to WhatsApp.

If you enter a number that’s already being used by WhatsApp (regardless if it’s a personal or a business account), once you link it here – you won’t be able to use it on a mobile device anymore, so we strongly recommend obtaining a new number for this integration.

You can enter your Business’ landline number also, you just need to select the “Phone Call” radio button below in order to activate it.

If you’re using a mobile number, you can also select the “Text message” option, and you will receive the verification code.

Please note that this is the number your customers will receive messages from.

Once you click on “Next” in the bottom right corner of the pop-up, you will receive the verification code.

verify-business-number

After you click on “Next”, you will receive an OTP message from WhatsApp to your WhatsApp business number. Enter the verification code (OTP number) and click the “Finish” button. Your number will be verified at this stage and it will be linked with your WhatsApp business account.

At this point, you’ve configured the phone number you’ll use for WhatsApp messaging if you want to actually chat with your customers, but in order to integrate it with Amelia, you will need a permanent access token.

In the “Getting Started” section, at the top, you will notice a “Temporary access token”, and a message that says “This token will expire in 23 hours”. This can’t be used in Amelia since if, for example, you want to send the message after 23 hours from NOW pass, the current access token will not work and you will need to log into the Facebook for Developers page again and click on the “Refresh” button in order to create a new token.

Instead of doing that, we need to create a token that never expires.

temporary-token

While logged into your Facebook for Developers account, access the Business Settings Page.

Under the “Users” section in the left sidebar, click on “System users”. You will see a blank page where you need to click on “Add” to add a user:

System-users

You will be prompted with Facebook’s Non-discrimination policy which you have to review and accept. Once you scroll through this modal and review the policy, click on “I accept” in the bottom right corner of the pop-up.

Please note: You may be periodically asked to review this policy to maintain compliance.

non-discrimination-acception

On the next screen, you’ll see a “Thank you” message from Facebook, and you only need to click on “Done” in the bottom right to continue creating a new user.

Enter the username and select the role “Admin”. Once you’re done, click on “Create system user”:

create-admin-user

You may, again, be prompted with Facebook’s Non-discrimination policy which you have to review and accept.

After you accept the policy again, you’ll see the newly created Admin user. In the right section of the screen, click on the “Add Assets” button.

add-assets

In the pop-up that appears, click on Apps, then select the App previously created for WhatsApp integration, enable the Full Control (“Manage App”) slider, and click on “Save Changes”.

Full-control

The next pop-up will inform you that a new asset has been added, and all you need to do is click on “Done”.

After that, in the left sidebar, under “Accounts”, click on “WhatsApp accounts”. Select the previously created business app (in our example, it’s named “Amelia”), and then click on one of the “Add People” buttons:

add-people

In the pop-up that appears, select the system user previously created, and then enable the “Full Control” option again and then click “Assign” in the bottom right corner:

whatsapp-assign

You’ll see a prompt that confirms that 1 Person has been added to the WhatsApp account, so just click “Done”.

After that, go back to the “System Users” section in the left sidebar (agree to Facebook’s Non-discrimination policy if prompted again), and click on the “Generate new token” button:

generate-token

Select the App from the drop-down menu, and scroll down. You will see a few notices, and below them, you’ll see the list of available permissions.

Scroll down and enable these two permissions:

  • whatsapp_business_messaging
  • whatsapp_business_management

After you select them, click on the “Generate token” button in the lower right corner of this pop-up.

generate-token

Finally, you’ll see the token that will not expire and that will be active forever, unless you click the “Revoke Token” button.

You can also verify the token scope from the Facebook token debugger tool and check the scope of the token added successfully or not.

Please note: Facebook will not remember this token, so copy it and save it someplace safe.

Permanent-token

WhatsApp Settings in Amelia

Now that we have a permanent token in Facebook for Developers, we can go back to the WordPress site. Under Amelia/Notifications click on the “WhatsApp Notifications” tab.

In there, you’ll need to paste the Phone Number IDPermanent access token, and your WhatsApp Business Account ID.

These can be found in your Facebook for Developers account, under Apps, previously mentioned here.

Amelia-WhatsApp-config

Once you save the configuration, you’ll be taken to message templates, that are similar to Email and SMS notifications.

The only difference is that WhatsApp templates can’t be configured in Amelia, but instead, you need to configure them in your Business Settings Page.

In the left sidebar, click on the three lines and then click on “WhatsApp Manager”:

whatsapp-manager

In the “Overview” section that appears next, click on the three dots on the right of the WhatsApp account you previously created, and then click on “Manage message templates”:

manage-message-templates

On the next page, you will be able to create new templates that will be used in Amelia. Simply click on “Create Message Template” in the top right to start.

When creating a template, the category needs to be “Transactional”. Then, you define the name of the template (you can use the same names seen in Amelia, like “appointment_approved”, “appointment_pending”, and so on) and select the languages that you use in Amelia. After you configure this, click on “Continue” in the top right corner.

Please note:

  • The name of the template needs to be lowercase without spaces. You can try adding them, and Facebook will automatically modify uppercase to lowercase, and replace spaces with an underscore.
  • The languages you select in the template need to be included in Amelia also. The default language is set in Notifications/WhatsApp Notifications when you access settings, but if you added more languages in Amelia’s General Settings, they will be available as well, so you can add these languages when creating templates in WhatsApp.
whatsapp-message-template

Templates in WhatsApp are similar but, again, different from creating templates for Email and SMS notifications.

The main difference is that you need to configure variables (placeholders) in the template, and they can only be numerical. As you can see in the screenshot below, these placeholders are not the same as Amelia’s (which are enclosed in % symbols), and they are shown as {{1}}, {{2}}, and so on.

An important thing here is to know which variable will be assigned to which placeholder in Amelia. For example, {{1}} in WhatsApp will be %service_name% in Amelia.

The Header and the Footer are optional, and the Header can include variables, while the Footer cannot. If you’re adding a Header, select “Text” from the drop-down and type your header as shown in the example below.

Once you create the template, click the “Submit” button in the upper right corner. If you forgot to add the template for another language, you’ll be prompted with a warning, so you can go back and add the template for another language.

creating-a-template

Each template you create will be reviewed by WhatsApp, and it usually takes an hour for it to be approved. An approved template will have a green circle next to the language, and a pending template will have a blank circle, as indicated in the screenshot below:

approved-pending-templates

Please note:

  • Once a template is approved, it can no longer be edited. Only rejected templates can be edited. If you need to modify the template once it’s approved, you will need to delete the old one and create a new template.
  • WhatsApp doesn’t accept line breaksTAB, and 4 spaces put together, so avoid using them in the template. Line breaks will be replaced with a semi-colon ( ; ).

Linking variables with Amelia Placeholders

Back in Amelia/Notifications/WhatsApp Notifications (once you refresh the page), when you click on the “Template name” drop-down, you will see the list of all templates created in the app (both approved and pending ones):

Amelia-template-selection

Select the template you want to associate with the Amelia template you clicked on (or created) and then you can continue linking the variables to placeholders.

Placeholders for Headers and placeholders for the message body are separate, so {{1}} in the header is not the same as {{1}} in the message body. All variables you added to the message template in WhatsApp will be added below the header and the message body, so you can link them.

First, the {{1}} variable needs to be linked to Category/%service_name% (in this example) in the header:

Linking-header-variables

Then, below that, you can see the message template pulled from WhatsApp, and below the template, you will be able to link the variables with placeholders in Amelia:

Linking-body-variables

When you’re done linking the variables to placeholders, scroll all the way down and click on the “Save” button in the lower right corner, to save the notification template.

Now, as in all other notifications, you can test the messages. Click on “Send Test WhatsApp Message”, enter the phone number you want the message to arrive to, and select the template you want to test.

The test message that you receive will replace the placeholders just like Email and SMS test notifications do – with test data (John Doe for the customer name, Richard Roe for the employee name, etc).

Amelia-test-message

Please note:

  • It is strongly advised to create a dedicated WhatsApp account with your business phone number.
  • You can use the Test Account that WhatsApp creates, but you will not be able to modify the name that appears in your customers’ WhatsApp, so they will see a non-reachable phone number as shown in the screenshot above, without the ability to respond (as you won’t be able to receive this message on an actual account without adding a real phone number here).