Custom codes can help you adapt the content of your messages to your guests, their listing, or their booking. 

In this tutorial, we will adapt a booking confirmation rule (sent under the Events flow, whenever there is a new reservation) to change its content based on the number of days to the check-in, and adapt the check-in instructions (sent under the Reservations flow) accordingly.

What the guest experience will be after this tutorial

If the guest has booked within 3 days (or earlier) from the check-in date:

This is the scenario where a new reservation is accepted on a Monday, a Tuesday, or a Wednesday, for a check-in on Wednesday (less than 3 days to the check-in date).

  • The booking confirmation message should thank the guest for the booking and include check-in instructions.
  • The scheduled check-in message will be skipped.

If the guest has booked more than 3 days from the check-in date:

This is the scenario where a new reservation is accepted on a Saturday or Sunday for a check-in on Wednesday (more than 3 days to the check-in date).

  • The booking confirmation will just thank the guest for the reservation.
  • A scheduled check-in instructions will be sent 3 days before the check-in.

We will perform this in three steps:

  1. Creating a custom code.
  2. Configure the booking confirmation template (under the Events flow).
  3. Configure the scheduled check-in message (under the Reservations flow).

Step 1: Creating the custom code

We will create a custom code, that will allow Smartbnb to manage a part of the booking confirmation message depending on the check-in date. Instead of setting up multiple rules, you will just need one that will adapt to multiple scenarios.

To create a custom code, you will need to get into the Custom codes tab on the Messaging Command Center: 

If you have just one Airbnb account connected to Smartbnb, this button will lead you directly there:

Make it work for one or all your listings.

Custom code can apply to each listing or to just one listing that you can choose. The advantage is that you can have a custom code with the same name across many listings, which is easier to manage in your templates. Each code can then have a different value.

Make sure you select the option that works best for you in the "See or create a custom code for" menu: 

For example, if you send the same instructions to all listings, just create a custom code for all listings; if you send more precise instructions that will depend on a listing, just choose one listing in particular.

Naming the custom code.

Once you have selected the right option for your setup, you can choose a name for the custom code. Since it can be anything, we will use to name our custom code instructions. 

That means we will use the custom code %%instructions%% in our template.

No need to add the percentage signs: they are added automatically.

Setting the condition.

We want to change the content of the booking confirmation whenever the check-in is within 3 days. This is possible by setting a condition for this custom code as "Check-in is within 3 days". 

Setting this condition means that if at the moment the booking confirmation is sent, the check-in is within 3 days, the code %%instructions%% will be replaced by the defined text.

Many other conditions are available (for example depending on the time before the check-in, or if the guest is coming with pets for example!).

Creating the text

Now that you have defined the scope of the custom code (whether it works for all or one listing), its name and the condition that has to be met, let's provide the actual text that will appear when the condition is met. 

Obviously, the choice is yours depending on your own constraints and style, but this may probably look like this:

This code will be integrated right into your booking template. It might make sense to include in here only what should be added to the booking confirmation message.

Just click on Create and hurray, you have done the hardest part!

Step 2: Integrate the code in your template

Once this is done, you will just need to integrate the newly created code %%instructions%% into your booking confirmation template.

For example, you could have something like so:

Please note the location of the %%instructions%% code. This means that if the message is sent within 3 days from the check-in date, it will be expanded into the text value. If there are more than 3 days to the check-in date, the code will instead be erased, and the message will be formatted to make sure there are no lines in excess.

Step 3: Skip check-in instructions on last minute bookings

At the current time, the booking might still trigger check-in messages to communicate the same check-in instructions to the guest. Naturally, we wouldn't want to send our guests redundant messages.

There is a great option to achieve just that on the Reservations flow, to make sure that people booking at the last minute don't receive those messages.

Little trick: The appreciation of booking being "last minute" is relative to the rule timing. For example, this rule is configured to send messages 3 days before the check-in, and would therefore consider any booking within those 3 days as a last minute booking. A rule configured to send messages 20 days before check-in would consider any booking within 20 days to the check-in date as being a last minute booking.

Did this answer your question?