TeamBooking Documentation

A complete booking system as simple as using Google Calendar.

Version 2.3.0

Getting started

MIGRATING FROM OLDER VERSIONS? PLEASE READ:

After the upgrade from v1.x or v2.0.x, all the Google Calendars of the Coworkers will need to be synced with your database. Please follow those steps:

  • Go to the Coworkers tab

  • For each of your Coworkers, press the Sync button (the one with double crossed arrows)

  • Wait until the process is done (it could take some time, so please be patient)

Plugin installation

In your WordPress admin dashboard, go to Plugins > Add New, and click on Upload Plugin button.

Choose the team-booking.zip file to upload (the one inside the main .zip package you have downloaded from CodeCanyon), and click to Install Now

Once done, activate the plugin.

Note: TeamBooking requires a version of PHP >= 5.3 and it's tested from WordPress 3.8 to the latest version.

Hey, I've activated the plugin and now I get an Unexpected T_STRING fatal error!

This is because your server runs a PHP version 5.2 or lower, so your site will hang with an Unexpected T_STRING fatal error. Normally, the plugin won't be activated in this case. If otherwise, your site will stuck on a white screen. Don't worry: just rename the TeamBooking plugin folder via FTP to manually deactivate it. Alternatively, switch to a more recent PHP version.

Updating the plugin

There are two ways to keep TeamBooking up to date.

Automatic update notification (recommended)

After the plugin activation, you'll be asked to install the recommended Envato Market plugin (if you don't already have it). This additional plugin, when configured, handles all the updates of your installed themes/plugins from Envato.

Great, but it's my first time with Envato Market plugin... what should I do, exactly?

Once installed and activated, you will notice a new dashboard item with a leaf logo. Click on it and go to the Settings tab:

Here you can chose between Global OAuth Personal Token or Single Use OAuth Personal Token.

A Single Use personal token is the one you should use if you have purchased TeamBooking on behalf of a client. Follow the instructions, then save the changes. From now on, you'll be notified by the Envato Market plugin of any item update, which you can do with just a click.

The update process should be seamless, anyway you'd better do a backup before updating, just in case.

Manual update, via FTP

Assuming you have just downloaded the latest plugin version from Envato, then follow those steps:

Core configuration

In order to access to Google Calendar(s) and operate with their data, TeamBooking uses the Google APIs. To use the Google APIs, you need to create a Google Project.

Let's see how.

Google Project setup

The Google Project is now successfully created and configured. It's time to go back to TeamBooking dashboard.

Team Booking's Core Settings tab

Do you remember the JSON file you've downloaded from the previous step?

Go to Team Booking => Core Settings tab. Click on Import from JSON file button.

Select that JSON file and hit OK. Now, the Client ID and Client Secret should be populated (and locked). The only empty field left is the Product name one. Fill it with the product name you just gave to the Google Project, and save the changes.

Now, the Product name field should be populated and locked too.

WARNING: once populated, Client ID, Client Secret and Product Name must not be changed. Doing this at some point later, will certainly cause issues with any already authorized coworker. Please keep this in mind, when you have multiple WordPress Administrators that can accidentally change those values. But if you really need to edit their values, assuming you know what you're doing, just press the lock switch, and the fields become editable.

TeamBooking is now ready to work with Google APIs. At this point you should define your business workflow.

Business workflow

TeamBooking is designed to make a team of service providers to work together, but of course it can work very well also if you're alone.

Essentially, there are two "actors":

The administrator can be also a service provider (coworker), and that's the case when you're running your business alone.

Ok, but how does that have anything to do with the WordPress roles?

All the WordPress administrators are administrators in TeamBooking also, and they have the ability to act as service providers too.

You can specify which additional WordPress role is allowed to act as service provider (coworker) in TeamBooking, via the Core Settings tab.

But let's make some examples.

Working alone

I am the administrator, and I am the service provider.

The typical usage case is a professional (e.g. a dentist) who wants to let the customers to book appointments through his own website.

In this case, the administrator and the service provider (coworker) are the same thing. He creates and configures the services, he plans the availabilities in his Google Calendar.

You don't need to allow any other WordPress role to be a service provider.

Working with a team

I am the business head, having a team of service providers. They should be able to plan their availabilities in their personal Google Calendars.

The typical usage case is: you run a business (e.g. a clinic) offering services, and you have a team of service providers (e.g. medics) planning availabilities for that services.

So you are the Administrator of the WordPress site, and the service providers are WordPress users with a certain role (e.g. Contributor, or Author)

You can be a service provider too (a medic, in our example), as we previously said, Administrators can always be service providers if they need to.

So, just choose the WordPress roles you want to make service providers (coworkers) under the Roles allowed to be Coworkers setting.

The other roles won't see any Team Booking settings page, in their WordPress dashboards.

And what if a service provider shares his Google Calendar with me, so I can plan and control his availability?

This is a particular use case which requires a little sub-paragraph:


Dealing with Google Shared Calendars

When you modify or create events in a shared Google Calendar, you will become the owner of those events. So the situation will be:

In this particular circumstance, TeamBooking is only allowed to read those events, but not to edit them. Which means the frontend calendar will be ok, but when someone tries to book one of those slots, this error comes out:

Cannot make the reservation! Sorry, you should contact the administrator providing these informations:
Google API error: Error calling PATCH https://www.googleapis.com/calendar/v3/calendars/{YOURCALENDAREVENTSTRING}:
(403) The operation can only be performed by the creator of the event.

which is quite descriptive, as it states that the plugin can't edit the event because its owner is not the same as the owner of the calendar.

What should you do, then? You need to change the ownership of the event, when you create it in a shared Google Calendar that isn't yours. Here's the steps:

  1. Once you have created an event in a shared Google Calendar, click on Edit event.

  2. On the event page that pops up, click on More Actions dropdown, to the upper-right corner. Then, select Change Owner...

  3. Select the owner of the calendar (the service Provider) as the new owner of the event.

  4. Click on Change Owner.

  5. Press Save.

Now TeamBooking is able to modify this event created by you (the Admin) in one of your service providers' Google Calendar.

Authorize the plugin

Note: If you are working with a team of service providers (coworkers), this step must be done by each of them.

In order to plan availability for the services, a service provider (coworker) must first give permission to TeamBooking to operate with his Google Calendar.

Depending on your business workflow, you may have just one service provider (you, the admin), or several service providers (a team).

Since this authorization process is something that happens between TeamBooking (or rather the Google Project behind it) and the Google Account of the service provider, it's important to understand that every service provider must go through the following authorization steps while logged in his own Google Account.

How can I (or any other service provider) give this authorization?

In order to give authorization, go to Personal settings tab in your TeamBooking dashboard. Press the Authorize button.

Now, two things can happen:

TeamBooking is now able to interact with your Google Account. Just one thing is left: choose one or more Google Calendars from your account.

Select your Google Calendar(s)

Once a service provider (coworker) gave authorization, Team Booking is able to interact with his Google Account. After that, he must choose the Google Calendar(s) he want to use (as you may already know, a Google Account can have unlimited Google Calendars).

Go to Team Booking => Personal Settings tab, and press the Add new button.

A modal will appear. Here you can select one of your Google Calendars.

Add it, and a new row in the table appears with your calendar properties. It's very important to ensure that the status is synced. Otherwise, just press the Sync button under actions to perform a manual sync request.

You can also check the Google Calendar's timezone and compare it to the local WordPress timezone. The plugin's frontend calendar always transpose all the times to the local timezone by default, unless the customer change the display timezone.

You can add multiple Google Calendars, if you need to. Just repeat the step.

At this point, Team Booking knows from which of your Google Calendars the data must be fetched.

Google Calendar's interdependency

Note: the following is only useful if you have added more than one Google Calendar

By default, a calendar is set to independent. That means that events on it can't affect (and can't be affected by) events that reside in other added Google Calendars.

Viceversa, if you de-select the independent status of a calendar, the events on it will affect (and be affected by) events that reside in all the other non-independent Google Calendars. This is particularly interesting, just as example, when you are used to keep your personal events in a separate Google Calendar but still want those events to block the services availabilities when they overlaps (see the Your Google Calendar settings paragraph for more details about overlapping features).

Keep them clean

The Delete past events button offers an interesting feature: you can keep your Google Calendar clean (and the database lighter and faster) by deleting the past events on it (going backwards from the last week as a security buffer). The eventual reservation records in the database won't be deleted.

Create services

Team Booking allows unlimited number of services. What is a service? It's an event, an appointment, a conference, a class, an estimate request, a room and so on: everything you're offering to your customers, that needs to be booked.

There are three classes of services:

How to create a new service?

Let's go

If you have followed all the previous steps, now the plugin is ready to work. You, or your service providers (coworkers) should now begin to plan availabilities and to learn how, please read the dedicated chapter of this documentation.

The next chapters are about configurations, settings and so on, so you can trim all the aspects in order to suit your needs.

Enjoy!

Core settings

Let's explore all the core settings of the plugin. Those are mainly set-and-forget.

Advanced settings

Roles allowed to be Coworkers

As already seen in the Getting Started paragraph, here you can configure which WordPress roles are allowed to be Service Providers (Coworkers).

Administrators are always allowed.

Roles that are not selected, won't see any TeamBooking tab in their dashboards.

Autofill reservation form fields for registered users

Depending on your WordPress membership configuration, it is possible that a registered user already provided some information in his profile, like e-mail address, first and last name, and so on.

If those fields are present in the reservation form, you can choose to pre-fill the data with the information fetched from the logged user profile, for customer's convenience.

You can also chose to pre-fill and hide those fields, so the customer is not able to modify the values.

Load the frontend calendar at the closest month with available slots

If selected, the frontend calendar will be automatically loaded at the nearest month with at least one free slot. Please note: the first page loading can be slower.

Allow customers to download ICAL file after a reservation

By activating that option, a button to download an *.ICS (ICAL) file will be shown immediately after the reservation. You can also add the ICS hook in the confirmation e-mail, so the customer can download the file from there.

Registration URL

When a guest tries to book a member-only service, a registration button will be shown. Here you can override the default WordPress registration link.

Keep reservations in database for

The reservations older than this timespan (relative to the reservation's starting date) will be deleted from the database.

Max pending time

If the payment is not made within this time, the reservation will be released. It affects only services where payment must be done immediately.

Note: Values too low could, in extreme cases, lead to payments after reservation is released. Furthermore, in order to process an IPN confirmation from off-site payment gateways (like PayPal), your server must be up and running. PayPal example: if your server is down, IPN will be resent by PayPal for up to four days, with a maximum of 15 retries. The interval will increase after each fail attempt.

Google Maps API key

If you have a Google Maps API key*, put it there. This is mandatory in order to use Google Maps for installations made after 22nd of June, 2016.

*The API key must have those API libraries enabled:

  • Google Maps JavaScript API
  • Google Maps Geocoding API
  • Google Places API Web Service
  • Google Maps Directions API (if you want the address autocomplete and the real-time directions feature)

Don't you have a Google Maps API key already? Just keep reading:

How to obtain a Google Maps API key

  • Remember the Google Project you created for the Core configuration? Well, go back to the Google API console and open it.

  • Click to Credentials and press the Create credentials button. Then choose API key.

  • Click on Browser key.

  • Choose a name for the key (e.g. "My Maps Key") in the first field, and insert the referrer in the second field.

    So, if your site is http://www.mysite.com, you should insert *.mysite.com/*.

    Then, press Create.

  • Copy the key and press OK.

  • Go to Overview and click on Google Maps JavaScript API.

  • Press Enable.

  • Repeat the last step for the Google Maps Geocoding API and Google Places API Web Service too.

    If you need the address autocomplete and the real-time directions features, repeat the last step also for the Google Maps Directions API too.

  • Once the APIs are enabled, go back to TeamBooking's Core settings and paste in the Google Maps API key field the API key you copied before.

Skip Google Maps library loading

Activate this option only if you know what you're doing.

If you have issues about double loading of Google Maps JavaScript library because of other maps library calls by your theme or by another plugin, you can bypass the TeamBooking's library loading.

By doing that, TeamBooking skips the Google Maps library loading, but every Google Maps eventual issue on the reservation form will be responsibility of the third-party theme/plugin which calls the Maps library first.

Import/Export of settings

You can import/export the TeamBooking settings in the relative panel.

Note: This is meant to pass the settings from one installation to another (e.g. going in production) or to restore the settings after a plugin uninstall/reinstall.

This is not meant to pass the settings between different versions of the plugin.

You do not need to do that after a plugin's upgrading.

You do not need to do that during a plugin's deactivation/reactivation.

Services

Administrators can configure the service's general settings, while a coworker is able to configure the relationship between the services and his personal Google Calendar.

Services management

Go to Team Booking => Services and you'll find a table with services infos: name, class, ID, color, the service specific shortcode and some other actions to perform.

Administrators will see the Active column, where they can conveniently activate/deactivate each service.

The Participate column allows a service provider (coworker) to choose to be or not to be available for that service. Instead of the switch, there will be some labels for particular circumstances:

The Actions column contains some interesting buttons, let's see what they do in the next paragraphs.

Email settings

In this menu you can configure all the emails that will be sent after a reservation.

Admin notification and customer confirmation

Note: only Administrators are allowed to this section.

The Admin address for receiving notifications is the e-mail address where the notification emails will be sent to. By default, it's the site's Admin e-mail address, but you can change it for your convenience. The change will be applied to the current service only.

Note: This address is the sender address of the confirmation e-mail sent back to customer, so it's better to use an e-mail address that belongs to the same domain of your site to avoid SPAM filters.

The Include uploaded files as attachment option lets you to attach the eventual files uploaded by customers in the reservation form to the e-mail. That's just for convenience, as the files will be saved on your site's upload folder anyway.

The subject and body configuration is quite straightforward. You can use HTML in any email content.

The dynamic data (i.e. the customer's name, or the reservation date and time) is represented by hooks. A hook is a placeholder that will be replaced with the relative content when the email will be sent. So, e.g., the [first_name] text hook will be replaced with John, and so on.

The available hooks are listed above any email body editor. Just click one of them, to insert it at caret point. Easy.

Hooks in-depth: along with the hooks relative to the reservation form fields, there are also fixed hooks with a special meaning. Those are:

  • [start_datetime], [start_date], [start_time]

    replaced by the start date and/or time of the reservation (formatted as per your WordPress general settings, adapted to customer's timezone when choosen)

  • [end_datetime], [end_date], [end_time]

    replaced by the end date and/or time of the reservation, if available (formatted as per your WordPress general settings, adapted to customer's timezone when choosen)

  • [timezone]

    replaced by the timezone of the date/times (the customer's timezone, if choosen)

  • [tickets_quantity]

    replaced by the number of tickets booked (Event class only)

  • [total_price]

    replaced by the total price of the reservation

  • [unit_price]

    replaced by the unit price (discounts included, increments excluded)

  • [post_id]

    replaced by the post id of the frontend calendar instance from which the reservation is done, only available if you've inserted the shortcode in a post.

  • [post_title]

    replaced by the post title of the frontend calendar instance from which the reservation is done, only available if you've inserted the shortcode in a post.

  • [coworker_name]

    replaced by the WordPress profile name of the service provider.

  • [coworker_url]

    replaced by the WordPress profile URL of the service provider. You can edit this URL of each service provider in the Coworkers tab.

  • [hangout_link]

    replaced with the Google Hangout link of the event (if available)

  • [service_location]

    replaced with the service location (if available)

  • [cancellation_link]YOUR TEXT[/cancellation_link]

    a link to let the customer to cancel the reservation, if allowed

  • [reason]

    replaced with the reason of the cancellation, of provided

  • [ics_link]YOUR TEXT[/ics_link]

    a link to let the customer to download the reservation ICS file, if allowed

  • [approve_link]YOUR TEXT[/approve_link]

    a link to let the admin or service provider to approve a pending reservation, if allowed

  • [decline_link]YOUR TEXT[/decline_link]

    a link to let the admin or service provider to decline a pending reservation, if allowed

Your personal notification

This box configures the e-mail message that TeamBooking sends back to you as a service provider (hence every service provider can customize this on his own, by accessing to the TeamBooking dashboard).

Exactly like the site admin's e-mail, you can choose to activate or deactivate the notification itself, to get files or not, and customize the subject and the content of the e-mail, using the hooks for dynamic data.

Note: as Admin, don't assume you are configuring the e-mail message that all the service providers gets. You can only configure the e-mail you, as a service provider, get. If you're an Admin but not a service provider, you can just deactivate this notification and let your service providers to configure it in their own TeamBooking dashboards.

Cancellation notification

Note: only Administrators are allowed to this section.

This is the e-mail sent to the customer when the reservation is cancelled. A reason text, if present, will be eventually added automatically to the e-mail content.

You can also configure a cancellation notification that is sent back to the admin and to the coworker, when a reservation is cancelled

Reservation form

Note: only Administrators are allowed to this section.

Settings

Note: only Administrators are allowed to this section.

In this menu are grouped the service's settings.

General settings

Payments settings

Frontend slot settings

Access settings

Approval settings

Cancellation settings

Here you can chose whether or not the customer should be able to cancel his reservations, and the time limit after he can't cancel a reservation anymore.

Redirect and conversion tracking

Your Google Calendar settings

This menu configures the relationship between your Google Calendar and the service.

Overlapping events settings

How other events in your Google Calendar must interact with the availability events, if they overlap? Just configure it!

Please note: the overlapping condition is evaluated when two events are on the same Google Calendar. If they are on different Google Calendars, then in order to be considered as overlapping both Google Calendars must be not independent (refer to the Google Calendar's interdependency paragraph to know more).

Clone a service

Press this button to create a carbon copy of this service, with same settings preserved. You'll be asked to give a new ID for cloned service.

Delete a service

Press this button to delete the service. A confirmation modal will appear.

Coworkers

If you are not going to use TeamBooking as a "team", you'll have only one service provider (the administrator). Otherwise, go to Core settings tab, and choose the WordPress roles that you want to make coworkers, under the Roles allowed to be Coworkers option.

Under the Coworkers tab, you'll find a list populated with your service providers.

Coworker's availability

Once a WordPress user becomes a service provider, he is immediately able to give availability for Unscheduled class services. In order to place availability for Appointment and Event classes, he must give authorization to TeamBooking to operate with his Google Calendar.

The Google Calendar column in Coworkers tabs reflects this situation for all the service providers.

Coworker's settings

The Settings button, under the Actions column, opens a modal where you can put a link to a specific service provider profile page. By default, the profile page is the WordPress author page of that user. This link will be applied to the coworker's name in the frontend calendar, if both Link coworker's profile page and Show coworker's name options are selected, under the service settings.

Here, you can also specify which services are allowed to that coworker. By default, all the services are allowed. When you create a new services, it will be allowed by default to all of your coworkers.

Customers

The Customers tab in TeamBooking's dashboard shows a list of your customers. They are automatically generated by the plugin, by scanning all of your reservations.

A customer is identified by his e-mail address. You can export the current customer's list in *.CSV or *.XLSX (if available).

The Status column of the table shows if a customer is Registered (i.e. it corresponds to one of your WordPress users) or Guest.

The Reservations column of the table shows a label with the total number of reservations relative to that customer. If you click on the label, a more detailed overview is shown.

In that overview, all the reservations made by the customer are sort by service.

If one of your Unscheduled class services has a limit on the number of reservations per customer, and that customer has reach the limit, a no left label will appear next to the service name. That means the customer can't place any more reservation for this unscheduled service.

To reset the counter (allowing the customer to book again), just click on the reset label.

Place availability

In order to place availability for scheduled services (Appointment and Event classes), a service provider must first give authorization to Team Booking to operate with his Google Calendar (paragraph 1.5).

There are two modes of placing availabilities for services, in your Google Calendar: the Slot Mode and the Container Mode. You can use both, as you prefer, under the right circumstances.

Slot mode

This mode is very simple. Just create an event in your Google Calendar, give the name of the service as title, and this will be read as free slot for that service.

Note: the event title must be exactly the same (case insensitive) of the Event title (free slot) field value (Team Booking => Services => Your Google Calendar button, under Actions column). By default, it's equal to the service name.

If the Slot duration rule for that service is set to Inherited from Google Calendar event, the slot start/end times will be the same as the Google Calendar event.

You can create as many events you need, even overlapping ones. They will be read as separate slots.

When a slot is booked, the relative event will be updated accordingly to the settings of Team Booking => Services => Your Google Calendar.

Container mode

The container mode works by the creation of a container event in Google Calendar. This container will be used by Team Booking to put free slots in it automatically.

In example, let's say you have a service called Music Class (with the Event title (free slot) setting equal to service name), with fixed slot duration of 1 hour and Buffer between consecutive slots set to 30min. Then you can create on Google Calendar an event called Music Class container, let's say from 8:00 AM to 12:00 AM.

Note: In order to be identified as a container for a particular service, an event in Google Calendar should be named as the Event title (free slot) value, plus the word container at the end.

The result on the frontend calendar will be: 3 free slots for Music Class service, respectively from 8:00 AM to 9.00 AM, from 9:30 AM to 10:30 AM and from 11:00 AM to 12:00 AM.

When one of them is booked, a new event will be created on your Google Calendar, inside the container event.

WARNING: The container mode will not be available, if the slot duration rule is set to Inherited from Google Calendar event.

Multiple services container

The container mode can also be used for multiple services management, and this is a very interesting feature.

Let's assume you have two kind of services, with different fixed durations (i.e. 60 min and 30 min) and so on. Let's assume you are available from 8:00 AM to 06:00PM, and you want to be available for both services, but if someone book a slot for service 1 (60 min each slot), then you can't be available for service 2 (30 min each slot) in those 60 min (so at least two slots of service 2 will be dropped), and viceversa if someone book a slot for service 2, you can't be available for service 1 in those 30 min (at least one slot of service 1 will be dropped).

Well, you should use the container mode in multiple service dress. How? It's very easy, just name your event in Google Calendar with your service's Event title (free slot) joined with a "+" sign, and put the "container" word at the end.

So, in our example, in order to use a Multiple Service Container for Service 1 (Event title (free slot) = 'Service 1') and Service 2 (Event title (free slot) = 'Service 2'), then the Google Calendar event must be named Service 1 + Service 2 container. That's it!

How events are updated

When a slot is booked, what happens to the relative Google Calendar event? We've just know how they'll change color and title, but that's not all. Let's have a closer look.

Service Class: Appointment

The Google Calendar event for Appointment Service, right after the reservation, will encounter the following changes:

Service Class: Event

The Google Calendar event for Event Service, right after the reservation, will encounter the following changes:

Editing the events

What happens if I edit or move an event in the Google Calendar?

It depends on what kind of event is it.

Frontend calendar

Shortcodes

In order to render a main frontend calendar, just use this shortcode anywhere in your page or post:

[tb-calendar]

Have you created more than one service? One for "Dental Care Session" and one for "Weekly Dentist Conference"? So using the [tb-calendar] shortcode will display all of the free slots in one calendar, all together (keeping the names separated).

In the post/page WordPress editor you'll find a comfortable TeamBooking button to insert shortcodes quickly:

Select Add calendar to open a shortcode configuraton for the main frontend calendar.

Select Add reservations list to open a shortcode configurator for the frontend reservations list.

Parameters are explained below:

Specific services

But, hey... maybe you want keep things separated! No problem, including only some events in a calendar frontend instance is very simple, just add the booking IDs list (not the names!) to the shortcode:

For your convenience, in the services list under Services tab, you'll find the specific single service shortcodes.

Specific coworkers

If you want to render a personal calendar for a specific coworker, you can do the same. Go to Manage coworkers tab, and grab the specific shortcode for the coworker. You can also mix multiple coworkers.

Mixed shortcodes

Shortcodes can be mixed, so i.e. you can render a calendar for a single coworker, with multiple services:

[tb-calendar coworker="1" booking="service-1, service-2"]

Read only calendar

If you want to render an informative frontend calendar without booking ability, just use the read_only attribute:

[tb-calendar read_only="yes"]

Hide the calendar to guests

If you want to completely hide the frontend calendar fon non-logged users, just use the logged_only attribute:

[tb-calendar logged_only="yes"]

Hide the filtering buttons

Filtering buttons for services and coworkers list will be shown by default, for the customer's convenience. If you don't want to show those buttons, you can specify that in the shortcode, using the nofilter attribute:

[tb-calendar nofilter="yes"]

Hide the timezone selector

If you want to hide the frontend timezone selector, just use the notimezone attribute:

[tb-calendar notimezone="yes"]

Change the slots style

If you want to specify the slots style (overriding the general setting for that) you can use the slot_style attribute:

[tb-calendar slot_style="1"]

Possible values are (at the moment) "0" for the default style (basic) and "1" for the Elegant style.

Widgets

The Team Booking Calendar widget shows a frontend calendar instance. You can choose which services to include, and if the calendar should be read-only (reservations not allowed). You can even choose to hide the filter button.

Note: The Widget CSS is slightly different from the Shortcode CSS. Widget calendar suits the sidebars best.

The calendar

Here's a classic frontend calendar:

Let's describe its sections. At the top of it, we see:

The header of the calendar itself has two left-right arrows to change the month back and forth. It has also the name of the month and the year currently displayed.

By pressing them, a fast selector will be unfolded, for example here's what you get by clicking on the month's name:

The main calendar area contains, in our example, a single day with free slots on it. In our example, the little numbered dot indicates how many free slots we have inside that day, but the meaning of the number can be configured (check the Style customization section of the documentation).

By clicking on a day with free slots, the slot's list will be displayed:

At the top-right corner, we have (depending on what slots information are available) some filtering buttons:

Those filters can be mixed together.

If the calendar is not read-only, just click on a slot to open the reservation form.

Frontend upcoming list

Shortcodes

In order to render a frontend upcoming events list, just use this shortcode anywhere in your page or post:

[tb-upcoming]

Parameters are explained below:

Specific services

Including only some events in the upcoming list is very simple, just add the booking IDs list (not the names!) to the shortcode:

Read only list

If you want to render an informative frontend upcoming list without booking ability, just use the read_only attribute:

[tb-upcoming read_only="yes"]

Set the number of events to be shown

By default, the upcoming list shows the next 4 events. You can change this value using the shown attribute:

[tb-upcoming shown="10"]

Allow the user to load more events

If you want to allow the user to load more events, you can use the more attribute:

[tb-upcoming more="yes"]

Hide the timezone selector

If you want to hide the frontend timezone selector, just use the notimezone attribute:

[tb-upcoming notimezone="yes"]

Limit the maximum number of events that can be shown

If you allowed the user to load more events, you can also limit the maximum number of them using the limit attribute:

[tb-upcoming more="yes" limit="30"]

Show the service's descriptions

If you want to show the service's descriptions in each slot, you can use the descriptions attribute:

[tb-upcoming descriptions="yes"]

Please note: if you have more than one slot for the same service, each slot will display the description.

Show the little calendar icon near each slot even if they are under the same day.

If you want to show the little calendar icon near each slot no matter if that day was already displayed, you can set to "no" the hide_same_days attribute:

[tb-upcoming hide_same_days="no"]

Change the slots style

If you want to specify the slots style (overriding the general setting for that) you can use the slot_style attribute:

[tb-upcoming slot_style="1"]

Possible values are (at the moment) "0" for the default style (basic) and "1" for the Elegant style.

Widgets

The Team Booking upcoming events widget shows a frontend upcoming events list. You can choose which services to include, and pretty much each attribute of its shortcode version.

Note: The Widget CSS is slightly different from the Shortcode CSS. Widget upcoming list suits the sidebars best.

Frontend reservation list

How to show the list

You can show to customers a list with all their upcoming reservations by simply adding the shortcode:

[tb-reservations]

This will render a simple table (styles/CSS are inherited from your theme) where a customer can inspect all his reservations and basic data such as the date and time, the coworker, the reservation status.

Note: The list will be rendered to logged users only. User profiles are managed by WordPress, and not by TeamBooking.

Cancelling a reservation

If a service has the customer's cancellation allowed, then the relative reservations records will display a "cancel" link under the Actions column. By clicking on this link, the reservation will be cancelled.

You could include a link to the frontend reservation list page in your confirmation emails, so a customer can easily reach it. A formula like "If you wish to cancel this reservation, then go here" will be great.

Payments

Payment Gateways

If at least one of your services is priced and requires an immediate payment, or the payment is discretional, you should activate at least one of the TeamBooking's bundled payment gateways.

TeamBooking is bundled with two payment gateways ready to be configured: PayPal and Stripe.

VERY IMPORTANT: when you're logged in as administrator, the plugin always skips any eventual payment step (so you can easily book a reservation on behalf of a customer via frontend). So, if you're willing to test the payment gateways, please do so while not logged in as administrator.

The first step, anyway, is to select your desired currency in the Payments gateway tab. Please note that TeamBooking checks if the selected currency is supported by your gateways, deactivating those who don't support the selected currency.

PayPal

IMPORTANT: in order to correctly use PayPal without issues, your server must be SHA256, TLSv1.2 and G5 compliant.

The PayPal gateway tab is quite self-explanatory. There you can configure your payments settings providing some basic information as PayPal account email and a redirect URL when payment is done.

Here's a settings overview:

Stripe

The Stripe gateway tab is quite self-explanatory too. There you can configure your payments settings providing some basic informations as Stripe secret key and publishable key, receipt and so on.

A note on credit cards: customer's credit card information will not be saved nor processed in your server, as TeamBooking uses the stripe.js library. That means: security is not your concern, credit card infos go from customer's pc straight to Stripe servers, and your server will receive just a token to process the payment.

How to setup a priced service

Here's an example on how to fully configure a priced service, let's say a "package delivery service", that suits your needs. We will assume you have already configured your currency and your payment gateways, as shown in the previous paragraph.

In the service settings, we're going to set a price of 10 $ and set the payment requirement to Immediately.

You can also choose Later,in which case you don't need a payment gateway, or At the customer's discretion,in which case the reservation is immediately confirmed, and the customer can choose to pay right after the reservation, or later in time (you'd better insert the payment link hook in the customer's confirmation e-mail message, to eventually allow this).

We are also going to set a particular option in the reservation form. If that option is selected by the customer, then a defined increment in the price is added.

In our example, we are going to do that with a Radio group custom form field, but you can do that with Select fields too. Near the option we want to set as a price increment, we should click on the little gear icon.

In the modal, we put a price increment value of 5.00 $ and press the Set button.

The gear icon is now green, and we must save the custom field (or the changes will be lost!).

Our paid service is now fully configured, and that's how the reservation form looks like:

Promotions

The Promotions tab of the dashboard lets you to promote your services by the creations of two kind of promotions:

When a reservation is made taking advantage of a particular promotion, the promotions used are listed under the reservation detail, in the Overview tab.

But let's see how to configure that promotions, in detail.

Campaign

By pressing the button New campaign, a new campaign modal will be shown. You will be asked to provide details about your campaign:

Then, just press the Add button to create your campaign.

Coupon

By pressing the button New coupon, a new coupon modal will be shown. You will be asked to provide details about your promotional coupon:

Then, just press the Add button to create your coupon.

Manage your promotions

The promotions list shows some useful information about your promotion campaigns and coupons.

Under the Actions column, you can delete your promotion (trash button) and edit your promotion (pencil button)

Furthermore, if we are inside the promotion time period, you can also deactivate the promotion (pause button) and reactivate it (play button).

The Status column can have those values:

Frontend appearance

When a service price is discounted by an active campaign, any service slot shows the discounted price:

The footer of the reservation form shows the discounted price too, in a more catchy way:

The discounted services are also evident in the services selection dropdown:

On the contrary, active coupon promotions are not evident unless the Book now button is pressed. At that point, in the reservation overview, a field for the coupon will be shown:

If a valid coupon code is redeemed, the price is updated accordingly:

Reservations

Introduction

In the Overview tab you can view and download all the reservation's data. Service providers, if not Administrators, can view only their reservations here.

Use the Search... filter at the top to perform search operations.

The data can be exported, for your convenience, as *.CSV and *.XLSX files (if supported by your server). Under Bulk actions you can export *.CSV and *.XLSX with selected reservations only.

Under the Actions column, you can do some operations like removing the record from the database, editing the payment status, approve or decline the reservation, cancel a confirmed reservation and see the reservation details.

Reservation details

In order to see the details, just press the lined icon beside each record, and a modal will appear.

The details are separated by sections like Customer, Booking and Payment (if available).

If the automatic reminder e-mail message is active for the reservation's service, near the customer's e-mail address you can check the status of the reminder.

You can trigger it manually, if needed, by pressing the Send now link.

At the top-right corner, there are two buttons. The pencil (if you are in the Customer section) allows you to edit the customer's data fields. Just press it, edit and save. The other one allows you to export a PDF sheet with the reservation's data.

Note: the PDF feature is still at its early stages. It will be more customizable soon.

Reservation status

Scheduled services (Event, Appointment)

By default, a reservation is confirmed (if approval is requested, then the default status is waiting for approval).

Administrators can cancel a reservation, so the slot will be freed and an email is sent back to the customer, just by pressing the "X" icon under the Actions column.

Note: When you cancel a reservation, Team Booking asks you to give an optional reason for that. The reason will be added to the email sent back to customer, and will be saved in the reservation record.

If the customers are allowed to cancel their reservations, they'll be asked to provide an optional reason too.

The cancelled status stands for a cancelled reservation. Just check the reservation details, in order to check for the cancellation reason, if given.

Unscheduled services

By default, a reservation is todo (if approval is requested, then the default status is waiting for approval) and it will be counted in the "Upcoming reservations" box. You (or the service provider) can change the status to done or vice-versa.

You can't modify the unscheduled reservation status if it's waiting for approval.

Payment status

Deleting a reservation

Just press the trash icon.

WARNING: deleting a reservation will not automatically cancel it, but just removes the record from the database.

Style customization

Frontend calendar

Team booking calendar renders out of the box, but a bit of customization is cool! In the Frontend style tab you can select the calendar background, the week line background colour, the pattern overlays, the free/booked slot colour, the borders and the behaviour of the little coloured dots. The calendar preview reflects the changes once saved.

Frontend schedule list

In the Frontend style, under the frontend schedule list section, you can customize the slots sorting logic and the price label color.

The sorting options are:

You can also choose the style of the slots. At the moment, there are two styles: "Basic" and "Elegant". This general setting can be overridden by the specific shortcodes attributes.

CSS fix for small fonts

Some of calendar fonts appear too small? This is often due the so-called 62.5% hack used by some themes. If your theme's stylesheet applies a 62.5% font size to the html element (or you have no clue, but the fonts are too small anyway), then you must activate this option.

Map styles

The plugin comes with some nice style presets for Google Maps. Those styles are picked from the big directory of Snazzy Maps.

You can also set the plugin to use the default Google Maps style.

Hey, I want more styles or I want to be able to create mine!

No problem at all! Just set the plugin to use the default Google Maps style, and then install the free Snazzy Maps WordPress plugin. With it, you will be able to browse the entire Snazzy Map styles database, choose your style and/or create yours. TeamBooking is fully compatible with it!

Translations

TeamBooking is programmed to comply with the WordPress translations standards (.po/.mo files). If you're not familiar with this system, then let's have a little overview on how translate the plugin in your own language without too much hassle.

Language files

All the language files are located inside the /languages plugin directory. Its structure is simple:


                /languages
                default.pot
                team-booking-en_US.mo
                team-booking-en_US.po
                team-booking-it_IT.mo
                team-booking-it_IT.po
            

As you can see, there are two .po/.mo couples already bundled. Those are the English (en_US) and Italian (it_IT) translations. If your WordPress site language is set to English (American), then WordPress automatically picks up the "en_US" couple. If your site language is Italian, then it picks up the "it_IT" couple. What if there are no .po/.mo couple for your current site language? Then, the plugin reverts to its default internal hardcoded strings (English) and the .po/.mo files are not loaded at all.

There is also the default.pot file, which is the "base" for any other custom translation.

Whether you wish to change some strings in an already present translation (i.e. from "Book now" to "Confirm"), or made a completely new translation, you'll need to edit those files and/or put new files in this directory.

Editing the strings

So, let's say you want to change some strings (i.e. from "Book now" to "Confirm") in the current language (English, en_US). Then you must edit the en_US .po/.mo couple. Editing those files with a text editor is very tricky, especially if you're not familiar with those files. So, you'd better make use of a proper translation software. There are many solutions around the web, here we go with PoEdit which is free, simple, multiplatform and powerful.

Alternative: you might want to consider using Loco Translate, a WordPress plugin that provides in-browser editing of WordPress .po translation files.

With PoEdit, you should open the .po (NOT the .mo) file you want to edit. You'll find the interface very simple, so you can easily perform a search to your desired strings and change them.

When finished, just save the file. PoEdit will also generate the .mo file (or overwrites the previous, if existent). So, if you are operating in locale, just copy the new .po/.mo couple and replace the previous one in the /languages directory via FTP.

WARNING: always keep a backup of your edited .po/.mo files, as they will be lost at every plugin update!

Create a new translation

HINT: Before starting your own translation, you may want to take a look at the public translations repository to see if there are translation files ready to be used for your language.

That repository is a place where user translation files are freely uploaded. They are not maintained nor controlled by the plugin's developer, so can be outdated. Anyway, an outdated translation file is a good starting point.

If you wish to completely translate the plugin to a new language, then you must operate with a slightly different approach than previous paragraph. Using again PoEdit, this time you must open the default.pot file. PoEdit will notify you that the .pot file is only a template, and asks if you want to create a new translation:

Press the button, select your language, and begin the translation work. For each string, just write your translation in the "Translation" field:

When you've finished with your translation, press the Save button, and you'll be asked to name your new .po file. You must (MUST!) stricly follow the WordPress naming rules, so the file name must start with team-booking- followed by the locale code of your language (i.e. German is de_DE, you can find a list of WordPress locales here). Pay attention to the name of the file, and to the locale code, or WordPress won't be able to load the translations.

When saved, PoEdit automatically generate the .mo file also. So you should copy those brand new .po/.mo couple and upload it to the /languages directory via FTP. Be sure your language is correctly selected in the WordPress general settings, and your new translations should be loaded instantly.

WARNING: always keep a backup of your custom .po/.mo files, as they will be lost at every plugin update!

Upgrading a custom translation

Let's say you've already translated the plugin in your language some versions ago. Now, a new version comes with a bunch of new strings. You could of course open the default.pot, but then you'll start again from scratch. Instead, you should open your custom .po file, go to the Catalogue menu and press Update from POT file.

Select the default.pot file bundled with the new plugin version, and PoEdit will merge the changes. Now you can just translate the new strings and save the .po file again.

Troubleshooting

Some calendar fonts are too small

Some of the frontend calendar fonts and/or elements like filter buttons are too small to read, in respect to my theme.

This is often a sad result of the so-called 62.5% hack used by some themes. Try to activate the CSS fix for small fonts in the Frontend style tab.

Events not showing

I've correctly setup the core settings and gave authorization in personal settings, but my availability slots in Google Calendar are not showing in the frontend caledar of my site.

Assuming that you've correctly configured the plugin as per documentation, if your availability slots are not showing up in the frontend, you must have missed something for sure. In particular, double (triple, if needed) check those things:

E-mail not sent

My customers don't receive the confirmation email, Admin/Coworker doesn't receive the notification email, or both. I'm sure the options to send those emails are activated.

Assuming that the issue is limited to emails only (i.e. the reservations are correctly recorded in your Overview tab), then the plugin is not directly responsible, as it triggers the WordPress core functions to send emails, and it uses the best practices to do so. The reason must reside elsewhere, here are a couple of suggestions:

The confirmation and notifications e-mail messages are sent, but the reminder e-mail is not sent automatically. It is sent only when I manually trigger it. All the customers or some of them are not receiving any automatic reminder e-mail.

The reminder e-mail messages are sent via the WordPress scheduler. The WordPress scheduler triggers the actions only when your site is visited. This behaviour is unreliable, and could lead to reminders sent too late, or not sent at all, especially when your site has low visits.

Unfortunately, the only solution here is to setup a real server's cron job, for which you might visit this very good blog post. It gives you also a deeper overview of how the WordPress scheduler works.

Reservations don't appear, or always pending

I'm sure some reservations were made, but I can't spot them anywhere in the Overview, neither confirmation or notification emails are sent.

Usually, this happens when you're using PayPal and there are some issue with it. In particular, when a payment is made through PayPal and it's requested immediately (in your service settings), the plugin puts the reservation in a "pending payment" status, and keep it in this "limbo" as long as the Max pending time setting in the Core settings tab says. During this time, in which essentially the plugin is waiting for the payment to be made and confirmed by PayPal, the availability slot disappears from the frontend calendar, but you can't see the reservation in the Overview tab yet.

We face two possibilities:

  1. The reservation payment status is Pending but you're sure that the payment was actually made because you've received an email from PayPal, or because you're testing the payment gateway by yourself.

    Your server is apparently not able to process the so-called PayPal IPN (instant payment notification), so the plugin can't acknowledge the correctly processed payment. What should you do?

    • Ensure that your server is SHA256 and TLSv1.2 compliant (test it), or it cannot receive the IPNs from PayPal due to security reasons.

    • If your server is compliant, then you should retrieve the error.log file of your server and inspect it (or send it to our support)

    • Next thing, activate both the IPN debug settings in the PayPal gateway settings

    • Then you should try to make a reservation while NOT logged as admin (you can use the PayPal sandbox, in order to not make real payments)

    • Wait some minutes and go back to the IPN debug section of PayPal Gateway settings, you should now be able to read the debug information (last errors and last IPN raw data).

    • Repeat the steps with both cURL and fsockopen options (PayPal gateway settings)

    • Contact our support

  2. The reservation is nowhere displayed. But it was made.

    The above steps are still valid, but you should check first of all your email inbox, as you may have received a Fraud notification email by the plugin. That means that at least one of the frauds check failed, and the details are in the email body. If you believe the failure is not legit, then please contact our support.

Error calling PATCH

The frontend calendar is OK, but when I try to book a slot this error appears:

Cannot make the reservation! Sorry, you should contact the administrator providing these informations:
Google API error: Error calling PATCH https://www.googleapis.com/calendar/v3/calendars/{YOURCALENDAREVENTSTRING}:
(403) The operation can only be performed by the creator of the event.

That means that the Google Calendar of the service provider (coworker) where the slot resides is shared and someone who's not the Google Calendar owner has created that slot.

Please check the paragraph 1.4.2.1 to know how to handle this situation.

Slots not in sync

The slots in the frontend calendars are different in number/not in sync with the events in Google Calendar.

Please try to force a full-sync of that Google Calendar in the Personal tab (check this paragraph as reference).

If you are experiencing this issue only while not logged in WordPress, then you must have some misconfigured caching plugin/system in place.

API

As of version 2.0, TeamBooking implements a REST API to make the interaction with its data easier for developers, or customizations of the data flow.

Important: this chapter is intended for developers. If you don't know what an API is, you can skip the reading.

Note: the API is still at early stage, so it could have some limits. Feel free to contact our support for any suggestion.

Auth tokens

In order to use the API, a client must provide an authorization token to identify itself.

Authorization tokens can be generated inside the Core Settings of TeamBooking's dashboard.

You can create a read-only token, or a token allowed to authorize writing data operations (e.g. edit, delete and so on).

A token can't be modified, but can be revoked (deleted).

Requests

Here's the list of currently available requests:

Reservations list (GET)

Returns the reservation entries.

GET YOUR-DOMAIN/wp-admin/admin-ajax.php?action=teambooking_rest_api
Parameter Required Value Description
operation yes get_reservations Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation.
coworker no int Coworker's ID. If specified, the response will contain only the reservations that belong to the coworker.
service_id no string Service's ID. If specified, the response will contain only the reservations for that service.
show_past no bool If TRUE, the expired reservations will be included in the response. Default is TRUE.

If successful, this method returns a response body with the following structure:

{
  "header": "200 OK",
  "code": 200,
  "response": [
    reservation Resource
  ]
}

Get reservation (GET)

Returns the specified reservation entry.

GET YOUR-DOMAIN/wp-admin/admin-ajax.php?action=teambooking_rest_api
Parameter Required Value Description
operation yes get_reservation Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation.
id yes int The reservation's ID.

If successful, this method returns a response body with the following structure:

{
  "header": "200 OK",
  "code": 200,
  "response": reservation Resource
}

Services list (GET)

Returns the services list.

GET YOUR-DOMAIN/wp-admin/admin-ajax.php?action=teambooking_rest_api
Parameter Required Value Description
operation yes get_services Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation.

If successful, this method returns a response body with the following structure:

{
  "header": "200 OK",
  "code": 200,
  "response": [
    service Resource
  ]
}

Get slots (GET)

Returns the free slots entries.

GET YOUR-DOMAIN/wp-admin/admin-ajax.php?action=teambooking_rest_api
Parameter Required Value Description
operation yes get_slots Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation.
service_id yes int The service's ID.

If successful, this method returns a response body with the following structure:

            {
              "header": "200 OK",
              "code": 200,
              "response": [
                slot Resource
              ]
            }
            

Edit reservation (POST)

Edit a reservation entry.

POST YOUR-DOMAIN/wp-admin/admin-ajax.php
Parameter Required Value Description
action yes teambooking_rest_api Must be provided with this value, to trigger the APIs.
operation yes edit_reservation Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation. NOTE: it must have been issued for write operations.
reservation yes reservation Resource The edited reservation resource. Please note that read_only properties will not be changed, even if you provide changes to them.

If successful, this method returns a response body with the following structure:

{
  "header": "200 OK",
  "code": 200
}

Cancel reservation (POST)

Cancel a reservation.

POST YOUR-DOMAIN/wp-admin/admin-ajax.php
Parameter Required Value Description
action yes teambooking_rest_api Must be provided with this value, to trigger the APIs.
operation yes cancel_reservation Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation. NOTE: it must have been issued for write operations.
id yes integer The reservation's ID

If successful, this method returns a response body with the following structure:

{
  "header": "200 OK",
  "code": 200
}

Sometimes, it could be present additional information in the response:

{
  "header": "200 OK",
  "code": 200,
  "response" : string
}

Delete reservation (POST)

Delete a reservation entry.

POST YOUR-DOMAIN/wp-admin/admin-ajax.php
Parameter Required Value Description
action yes teambooking_rest_api Must be provided with this value, to trigger the APIs.
operation yes delete_reservation Must be provided with this value, to trigger the operation.
auth_token yes string The authorization token to perform the operation. NOTE: it must have been issued for write operations.
id yes integer The reservation's ID

If successful, this method returns a response body with the following structure:

{
  "header": "200 OK",
  "code": 200
}

Resources

A resource is a data object with properties and values. Here's a list of current TeamBooking API resources.

Reservation resource

The reservation resource has the following structure:

{
  "type" : (read-only) "reservation",
  "id" : (read-only) integer,
  "coworkerID" : (read-only) integer,
  "customerUserID" : integer, // "0" if not registered
  "customerTimezone" : string,
  "service" : {
    "id" : string,
    "location" : string
  },
  "datetime" : {
    "start" : integer, // Unix time in seconds
    "end" : integer // Unix time in seconds
  },
  "payment" : {
    "amount" : integer,
    "isPaid" : boolean,
    "currency" : integer,
    "gateway" : string
  },
  "status" : string, // "confirmed", "pending", "waiting_approval", "done"
  "tickets" : integer,
  "creationDateTime" : (read-only) integer, // Unix time in seconds
  "reminderSent" : boolean,
  "referer" : {
    "postID" : integer,
    "postTitle" : string
  },
  'formFields' : [
    form_field Resource
  ]
}

Service resource

The service resource has the following structure:

{
  "type" : (read-only) "service",
  "id" : (read-only) string,
  "name" : string,
  "class" : (read-only) string, // "event", "appointment", "unscheduled"
  "color" : string,
  "description" : string,
  "isActive" : boolean,
  "notificationEmailAdmin" : {
    "send" : boolean,
    "address" : string,
    "subject" : string,
    "body" : string
  },
  "confirmationEmail" : {
    "send" : boolean,
    "subject" : string,
    "body" : string
  },
  "reminderEmail" : {
    "send" : boolean,
    "subject" : string,
    "body" : string
  },
  "approval" : {
    "requireFrom" : string, // "admin", "coworker", "none"
    "keepFreeUntilApproval" : boolean
  },
  "cancellationByCustomer" : {
    "allow" : boolean,
    "timespan" : integer //seconds, relative to the reservation's start time
  },
  "payments" : {
    "price" : integer,
    "required" : string, // "immediately", "later", "discretional"
  },
  "loggedOnly" : boolean,
  "maxTotalTicketsPerSlot" : integer,
  "maxUserTicketsPerSlot" : integer,
  "maxReservationsPerLoggedUser" : integer,
  "location" : {
    "setting" : string, // "none", "inherited", "fixed"
    "address" : string
  },
  "redirectURL" : string,
  "assignment" : {
    "rule" : string, // "equal", "direct", "random", "none"
    "directCoworkerID" : integer
  }
}

Slot resource

The slot resource has the following structure:

{
  "type" : (read-only) "slot",
  "serviceID" : (read-only) string,
  "serviceName" : (read-only) string,
  "serviceDescription" : (read-only) string,
  "location" : string,
  "coworkerID" : integer,
  "isSoldout" : boolean,
  "isAllday" : boolean,
  "tickets" : integer,
  "start" : string,
  "end" : string,
  "gcalEvent" : string,
  "gcalParentEvent" : string,
  "gcalID" : string,
}

Form field resource

The form_field resource has the following structure:

{
  "type" : (read-only) "form_field",
  "name" : string,
  "value" : string,
  "priceIncrement" : integer
}

Hooks

TeamBooking has some useful WordPress hooks that you can use in order to deeply customize the aspect, add custom content or trigger custom actions at certain points.

Note: that section requires some very basic programming skills. The WordPress actions/filters usage is well documented, anyway in order to take the full advantage of the TeamBooking objects and perform operations on them, you need to know the structure of them. Feel free to ask questions to our support.

Warning: any custom come must be placed in a custom plugin, or in your child theme's functions.php file. Placing custom code in one of the TeamBooking's files, will result in that code being deleted after an update.

Action hooks

Those are the hooks used to perform custom actions at certain point of the reservation flow.

tbk_reservation_before_processing

Fired right before processing a reservation. You can use this hook, for example, if you want to implement your custom code to allow or prevent the reservation depending on some conditionals.

Examples

tbk_calendar_click_on_day

Fired right after clicking on a day on the calendar.

Examples

tbk_schedule_slot_parse

Used to perform operation to the slot before passing it to the frontend calendar.

Note: changes to the slots will affect also requests made by the REST API

Examples

tbk_reservation_email_to_admin

Called just before the notification e-mail to the Admin is prepared. Functions hooked to it can manipulate two arguments: the email object and the reservation's data object.

Examples

tbk_reservation_email_to_coworker

Called just before the notification e-mail to the Coworker is prepared. Functions hooked to it can manipulate two arguments: the email object and the reservation's data object.

Examples

tbk_reservation_email_to_customer

Called just before the confirmation e-mail to the Customer is prepared. Functions hooked to it can manipulate two arguments: the email object and the reservation's data object.

Examples

Content hooks

Those are the hooks used to add custom content at certain parts of the frontend.

tbk_schedule_slot_render

Used to append custom content to the slots in the slots list.

Examples

tbk_email_hook_replace

It is called every time a hook (text between square brackets) is found in the e-mail body. You can intercept all the content between square brackets and do some pretty handy customizations. So you can also create your own hooks and replace them with your own logic!

Examples