Custom codes help you tailor messages to different guests, reservations, and properties—without rewriting your templates each time.
Overview
Custom codes are reusable blocks of text (from a sentence to a full paragraph) that you can insert into:
Messaging rules
Teammate notification rules
Other custom codes (often called "nesting") to create even more detailed conditions and customisation
They:
Are created and managed by you
Contain only the text you write
Trigger at a condition set by you
Can be scoped to specific properties, hosts, and platforms
How to use custom codes
Custom codes are separate from Messaging rules; they are not sent on their own. Custom codes must be added to active messaging rules in order for their content to be sent to the guest.
After creating a custom code, make sure to add it to an active messaging rule.
To add a custom code to a messaging rule:
Go to Hospitable > Guest experience > Messaging
Select the Custom codes tab
Create your custom code:
Add the text in the text field
Scope it
Set any condition you want
Switch to the Rules tab
Select the messaging rule you want to add the custom code to
In the text field of the messaging rule, type
%%and the start of the name of the custom codeSelect the custom code
And you're done!
The changes save automatically.
See more here: Adding Custom Codes To a Messaging Rule
🚨 Important: Only Custom codes have "Conditions". Messaging rules have certain Settings that can determine whether they are sent, but not Conditions!
Custom Codes vs. Short Codes
Short codes, like custom codes, are used to personalise your guest messages. However, these are populated from information related to the guest's reservation details, personal details, property or listing details, whereas the content in custom codes is written entirely by you.
It’s helpful to understand how these differ:
Feature | Short Codes | Custom Codes |
Source | System-generated | User-defined |
Purpose | Pull dynamic data (e.g., guest name, dates) | Insert static, reusable text |
Scope | Global | Property-specific |
Appearance | Green ( | Purple ( |
When to Use Custom Codes
Use custom codes when you want to include content that only applies in certain situations, such as:
Instructions for specific properties
Details for longer stays
Notes for families or specific guest types
Variations in check-in or house rules
Skipping a message on specific conditions
Examples of how to use custom codes
"I don't want this message to be sent if the guest has recently messaged me"
Let's say you have a "First morning" message, which checks in on the guest on the morning after their first night at your property, just to make sure they've settled in well and are doing okay.
Let's say this message is scheduled to be sent out at 9 AM, but at 8 AM, the guest messaged you to say the coffee machine is broken, and you didn't see their message until 9:15 AM.
If the "First morning" message was sent out automatically, it might come across as if you didn't read the guest's message, or that you completely ignored it.
To avoid this, you could create a custom code and use the "the guest has last replied ... hours ago" condition!
For example, you could set that to 2 hours.
Add your text to the custom code instead of the messaging rule, and include only the custom code in the messaging rule.
That way, if the guest last messaged you 1 hour before the scheduled message is due to be sent, the custom code won't be populated.
Hospitable never sends an empty message, so if the custom code is the only text in the messaging rule, and it can't be populated, no message will be sent to the guest.
However, if the guest messaged you more than 2 hours ago, the message will be sent.
"I need to let my cleaner know if there are more than X number of guests arriving, so that they can prepare the sofa bed"
Let's say your place sleeps four people in the two beds it has, but it accommodates an extra two guests on the sofa bed, but the sofa bed needs to be prepared before their arrival.
In this case, you would use the "there are ... guests arriving" condition, and set it to "More than 4". In the text field, you would ask your cleaner to please prepare the sofa bed for the booking.
Then, you include this custom code in the "Before check-in" notification rule that you send to your cleaner, and it will only trigger if there are 5 or 6 guests arriving.
That way, the sofa bed will be ready before their arrival, without you having to manually message your team.
"I host a lot of returning guests, and want my messaging rule to say different things, depending on whether the guest is a return guest or not"
It would make sense to have differentiated messages for first-time and return guests, so that you don't sound repetitive or keep telling them things they already know.
For this, you can use the "the guest is / is not a return guest" condition.
You can create two custom codes, one set to "is a return guest" and the other set to "is not a return guest".
You then write the relevant text into each one, and include both custom codes in the same messaging rule. Hospitable will send the correct one, based on the guest's booking history with you.
Tips
Use short codes for dynamic data and custom codes for tailored messaging
Preview your templates to ensure everything displays correctly
Keep your custom codes updated as your property details change
