Install
Works with Drupal: ^9.4 || ^10.2 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Release notes
This release migrates BEE Hotel guest messages to Drupal's native Token API. Guest message tokens are now registered with hook_token_info() and resolved via hook_tokens(), replacing the previous custom YAML-based system.
Important: The legacy token syntax is still supported for backward compatibility, but some legacy tokens may no longer resolve correctly after this update, especially those that depended on data no longer read from the order item fields. Site builders are strongly encouraged to review existing guest message templates and update them to use the new [bee_hotel_booking:token_name] syntax. See the "Upgrade Instructions" section below.
New Features
- Drupal Token API integration. Guest message tokens are now exposed as standard Drupal tokens, making them available in the token browser, text formats, and any other module that relies on the Token API.
- Guest messages settings form. A new "Guest messages tokens" section has been added to the BeeHotel settings form, allowing site builders to configure property name, address, phone, email, and bank details used by guest message tokens.
- Default check-out time. A "Default check-out time" field has been added to the "Date and time" settings section.
Bug Fixes
- Fixed the validation of the "Cancellation Policy Days" field, which previously rejected all values due to a strict type comparison between string and integer.
- Fixed
arrival_dateandarrival_timetokens to read from the BAT booking start date instead of the order item creation timestamp. - Fixed
checkout_dateto read from the BAT booking end date, since the order item'sfield_check_outis empty in production data. - Fixed
checkin_timeandcheckout_timeto read the correct configuration keys saved by the settings form.
Improvements
- Guest message actions in the order page now use a single-column layout with larger card titles for better readability.
- The "Edit" action is now visually separated from the send actions (email, copy, WhatsApp).
- Property email is now validated with Drupal's
email.validatorservice.
Developer Notes
- Token definitions and resolvers have been moved from
bee_hotel.moduletobee_hotel.tokens.inc. BeeHotelGuestMessageTokens::applyTokens()now delegates to\Drupal::token()->replace().- The legacy YAML-based token system remains active for backward compatibility and will be removed in a future major release. Do not rely on it for new templates.
Issue Reference
See Issue #3634496 for the full discussion and change record.
Upgrade Instructions
- Update the code as usual and clear the caches (
drush cror Configuration > Development > Performance > Clear all caches). No database updates are required. - Open the settings form at Configuration > BEE Hotel > Settings and fill in the new fields under Guest messages tokens (property name, address, phone, email, bank details) and the Default check-out time under Date and time. Without these values, the corresponding tokens will resolve to an empty string.
- Review every existing
guest_messagecontent item. Open each one in edit mode and check the token list shown in the "BeeHotel tokens" section of the message field. Tokens still written in the legacy[token_name]syntax may no longer resolve correctly. Replace them with the equivalent[bee_hotel_booking:token_name]syntax shown in the same section. - Send a test message to yourself for one real order and confirm that no token placeholder remains visible in the final email or WhatsApp message.
Note on backward compatibility: The legacy [token_name] syntax is still processed as a fallback, but its behaviour is not guaranteed to match the new tokens. If a legacy token no longer resolves, it will appear as plain text in the message sent to the guest. Always verify templates after the update.