Install

Works with Drupal: ^9.4 || ^10.2 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 438.42 KB
MD5: d0cce242c938cc1a30c061623c7ce218
SHA-1: b862a11f90a462d43a9c8d5c0463fd3af6f41b29
SHA-256: 272517865a48502ff076a287a10e26202afb42c8e0628a49b37ab76fb2868406
Download zip 610.01 KB
MD5: fdd403806f61f4659522babf119c4c1b
SHA-1: d90f8a5d8cb14d87e450a0b15d56b1bcc5ac7299
SHA-256: 8b18ad3f40e680fa84836192a3d4fe654149bea97cdd18d37a45730312a05902

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_date and arrival_time tokens to read from the BAT booking start date instead of the order item creation timestamp.
  • Fixed checkout_date to read from the BAT booking end date, since the order item's field_check_out is empty in production data.
  • Fixed checkin_time and checkout_time to 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.validator service.

Developer Notes

  • Token definitions and resolvers have been moved from bee_hotel.module to bee_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

  1. Update the code as usual and clear the caches (drush cr or Configuration > Development > Performance > Clear all caches). No database updates are required.
  2. 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.
  3. Review every existing guest_message content 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.
  4. 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.

Created by: afagioli
Created on: 31 Oct 2026 at 12:08 UTC
Last updated: 31 Oct 2026 at 12:09 UTC
Bug fixes
New features

Other releases