> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dittofeed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Appointment Reminders

> Example journey for sending appointment reminders to users.

This guide walks through an example journey for sending appointment reminders to users. This guide highlights the use of [Event Entry Journeys](/resources/journey-nodes/entry#event-entry), [Keyed Performed Segments](/resources/segment-nodes/keyed-performed), and [Keyed Performed User Properties](/resources/user-property-types/keyed-performed).

This journey will perform the following steps:

1. Wait until 1 day before the appointment time.
2. Check if the user has cancelled their appointment.
3. If the appointment has not been cancelled, send an appointment reminder.
4. Wait for the user to confirm that they have attended the appointment.
5. Send a thank you message to the user.

## Creating the Journey

First, we'll create a new event entry journey, listening for the `APPOINTMENT_BOOKED` event, keyed on the `appointmentId` property.

```json theme={null}
{
  "event": "APPOINTMENT_BOOKED",
  "type": "track",
  "properties": {
    "appointmentId": "123",
    "className": "Yoga",
    "appointmentTime": "2024-12-01T10:00:00Z"
  },
  ...
}
```

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-entry.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=b2f14c238236e02f0ce08650b346f7b2" alt="Appointment Reminders Entry" width="3680" height="2382" data-path="images/appointment-reminders-entry.png" />
</Frame>

Then, we'll create a new user property, on that same `APPOINTMENT_BOOKED` event, with the same `appointmentId` key, but rendering the appointment time as the value.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-time-user-property.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=88950d1cb08e33dc62916dbeea04d483" alt="Appointment Reminders Time User Property" width="3680" height="2382" data-path="images/appointment-reminders-time-user-property.png" />
</Frame>

Then we'll create a delay node, using the [user property variant](/resources/journey-nodes/delay#user-property-delay), with the user property being the `appointmentTime` user property we just created. We'll set an offset of 1 day prior to the appointment time.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-delay.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=5d10811e14534a5a85f69adfbed834ee" alt="Appointment Reminders Delay" width="3680" height="2382" data-path="images/appointment-reminders-delay.png" />
</Frame>

Note, that because both the event entry node and the user property node have the same `appointmentId` key, we can be sure that the user property will wait on the same `appointmentTime` specified in the trigger event, as opposed to any other concurrent `APPOINTMENT_BOOKED` events.

Next, we'll create a segment which looks for `APPOINTMENT_CANCELLED` events, keyed on the `appointmentId` property.

```json theme={null}
{
  "event": "APPOINTMENT_CANCELLED",
  "properties": {
    "appointmentId": "123"
  },
  ...
}
```

Similarly, because the `appointmentCancelled` segment and our journey are both keyed on the `appointmentId` property, the segment will wait on a cancellation event that corresponds to the same appointment booking used to trigger the journey.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-cancelled.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=a2f2c4394dad97b06923159f0dd3bb0d" alt="Appointment Reminders Cancelled" width="3680" height="2382" data-path="images/appointment-reminders-cancelled.png" />
</Frame>

Then we'll use this segment to create a segment split, to check if the appointment has been cancelled.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-cancelled-split.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=3b9ae3d1593b60391d7b8a9590a13bf2" alt="Appointment Reminders Cancelled Split" width="3680" height="2382" data-path="images/appointment-reminders-cancelled-split.png" />
</Frame>

Next, we'll create a user property for rendering the class name in the message.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-class-name-user-property.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=1cddacf6d57bc6f8473d62bf0d556dc3" alt="Appointment Reminders Class Name User Property" width="3680" height="2382" data-path="images/appointment-reminders-class-name-user-property.png" />
</Frame>

Then, we'll create a message node to send an appointment reminder, with the message template using the class name user property.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-message.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=9f32942213162b48fad2005005ceb37d" alt="Appointment Reminders Message" width="3680" height="2382" data-path="images/appointment-reminders-message.png" />
</Frame>

We'll now need to create a segment to check if the user has confirmed that they have attended the appointment.

```json theme={null}
{
  "event": "APPOINTMENT_CONFIRMED",
  "properties": {
    "appointmentId": "123"
  },
  ...
}
```

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-confirmed.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=c0779736e097bc0d85dee404cbc8f7f3" alt="Appointment Reminders Confirmed" width="3680" height="2382" data-path="images/appointment-reminders-confirmed.png" />
</Frame>

Then we'll incorporate this segment into a wait-for node, to wait for the user to confirm that they have attended the appointment.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-confirmed-wait-for.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=376790bad33972dd00383461407ae771" alt="Appointment Reminders Confirmed Wait For" width="3680" height="2382" data-path="images/appointment-reminders-confirmed-wait-for.png" />
</Frame>

Finally, we'll create a message node to send a thank you message to the user.

<Frame>
  <img src="https://mintcdn.com/dittofeed/MR-erTsdiKcJhyyj/images/appointment-reminders-thank-you.png?fit=max&auto=format&n=MR-erTsdiKcJhyyj&q=85&s=ed64c7c8044d8fa6faaf13bf1070e32b" alt="Appointment Reminders Thank You" width="3680" height="2382" data-path="images/appointment-reminders-thank-you.png" />
</Frame>
