0.0.5 • Published 1 year ago

wbb-google-calendar v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

WBB Google Calendar Integration

This project allows you to easily integrate with Google Calendar to fetch free times, and create calendar entries.

Setup

After importing the content for this integration you will be provided with a series of blocks that you can use within your content. As a minimum the blocks will first collect a day that you'd like to arrange a meeting for, and then after collecting a relevant time slot it'll ask for an email address so that it can be invited to the meeting. The start of this flow is the Schedule Meeting block. The Confirmation block is the end of the process and is a basic block allowing you to change the response message etc.

To use this integration you will need a GCP Service Account. This allows the service account to read the calendar, and create calendar entries on behalf of another user. You will also need to configure Domain wide delegation as described in the following notes. This allows the service account to act on behalf of the owner of the calendar.

Finally you may need to invite the service account to be able to make changes to the calendar. This is done via the settings of the calendar as shown below. The email address to invite is that client_email property from within the service account file. This step may not be required.

GMail Settings

Blocks Provided

This integration provides the following blocks under the topic of Google-Calendar.

  • Schedule Meeting - the start of the process that will ask the user for a date for the appointment.
  • Confirmation - the end of the process, for when the meeting has been scheduled.
  • No Calendar Id set - an edge case for when the required settings have not been provided.
  • Confirm Time Selection - replays the selected date & time to the user for confirmation.
  • Create Calendar Entry - follows the Confirm Time Selection block and actually creates the event.
  • Clear Selection - Provides a mechanism to reset the form, and lets the user choose a new date.

Handler Names

The following handler names and their functions are available :

Handler NameBlockPurpose
find-free-timesSchedule MeetingWhen given a specific date, will attempt to find free time slots for the current calendar on that day
confirm-selectionConfirm Time SelectionPlays back the selected date & time to the user for confirmation
create-eventCreate Calendar EntryCreates the entry in the calendar and sends the user an invite

Configuration Options

Within the function there are a number of options that can be set to configure the behaviour of the integration. The tables below show the settings that are available for each handler.

find-free-times

PropertyRequiredDescription
credentialstrueThe JSON Service Account credentials for an account that has access to the calendar in question.
freeSlotMessagefalseThe message to display to the user ahead of the choices, when free slots are available.
noSlotsMessagefalseA message to show to the user if there are no available slots.
startAgainMessagefalseWhat is displayed on the button allowing the user to select a different day.
tryAgainBlockfalseId of the block that will ask which date the calendar entry is to be booked for
eventDurationfalseThe desired size of gap to look for in a calendar, defaults to 30 min
calendarIdtrueThe email address of the calendar you wish to search, ie, andy@wbb.ai
dateFormPropertyNametrueThe property name in the form that contains the date you wish to search for.
earliestHourfalseThe earliest time a meeting can be booked
latestHourfalseThe last time within the day to accept meetings
excludeTimesfalseAn array containing times to exclude
confirmationBlocktrueThe block to send the user to after selecting a time.
dateFormatfalseThe format to display the date in, defaults to dddd, MMMM Do YYYY

confirm-selection

PropertyRequiredDescription
confirmationMessagetrueDisplays the confirmation message to the user for the date and time they've selected
tryAgainBlocktrueId of the block that will ask which date the calendar entry is to be booked for
createEventBlocktrueThe Id of the block used to create the calendar entry
createMessagefalseThe label on the button someone should click when they've confirmed everything is okay.
startAgainMessagefalseWhat is displayed on the button allowing the user to select a different day.
dateFormatfalseThe format to display the date in, defaults to dddd, MMMM Do YYYY

create-event

PropertyRequiredDescription
credentialstrueThe JSON Service Account credentials for an account that has access to the calendar in question.
calendarIdtrueThe email address of the calendar you wish to search, ie, andy@wbb.ai
calendarTitlefalseThe subject of the calendar entry
calendarLocationfalseDetails of the location of the meeting.
calendarDescriptionfalseNotes that appear in the description of the meeting.
durationtrueDuration, in minutes. ie, 30.
emailFormPropertyNamefalseThe property name in the form that contains the email address you wish to invite to the meeting
confirmationBlocktrueBlock to redirect to when complete.