Hello HivePress team,
I’ trying to create a custom booking setup using HivePress Rental Hive + WooCommerce, and I’m trying to make the email system minimal, automatic, and informative. I’ve already read the documentation and used successful examples from your community (including from user lolofora), but I’m still stuck on several issues.
here my last chat that acttuallay helped:
How to add more booking and vendor details to the Booking Confirmed email? - General / Bookings - HivePress Community
Current setup:
-
I use 3 email templates:
booking_confirm_user(for the guest)booking_confirm_vendor(for the host)booking_accepted(after host approval)
-
I’ve disabled the HivePress Messenger (no contact before approval).
-
WooCommerce via Stripe.
Working tokens (confirmed):
%booking.start_date%,%booking.end_date%%booking.total%%booking.adults%,%booking.children%%vendor_user.display_name%%vendor_user.email%%user.display_name%,%user.email%
Not working or inconsistent tokens:
%vendor.bank_number%→ works inbooking_confirm_vendor, but does not work inbooking_confirm_useror afterbooking_accepted%booking.nights%→ I need this token, but it doesn’t exist by default.- A token for the remaining amount guest has to pay host (total – commission) is missing – I tried calculating it manually in a snippet but it’s unstable.
- A token for direct pay amount - what is left to pay and hos
Snippets I currently use:
php
KopiérRediger
add_filter(
'hivepress/v1/emails/booking_confirm_user',
function( $email, $booking ) {
$vendor = $booking->get_vendor();
$vendor_user = $vendor->get_user();
$email['tokens']['vendor_user.display_name'] = $vendor_user->get_display_name();
$email['tokens']['vendor_user.email'] = $vendor_user->get_email();
$email['tokens']['vendor.bank_number'] = $vendor->get_attribute('bank_number');
$email['tokens']['booking.total'] = $booking->get_amount();
$email['tokens']['booking.adults'] = $booking->get_adults();
$email['tokens']['booking.children'] = $booking->get_children();
$email['tokens']['user.display_name'] = $booking->get_user()->get_display_name();
$email['tokens']['user.email'] = $booking->get_user()->get_email();
return $email;
},
10,
2
);
I have a similar snippet for booking_confirm_vendor.
What I’m asking for:
-
A full list of HivePress emails (to guest and host) in chronological order — I need to know which ones are triggered when, and which support custom tokens.
-
How to reliably add a
%booking.nights%token. -
How to calculate and display a token like
%booking.remaining_to_host%= total – commission (so guest sees what to pay host). -
How to message amount for “direct pay” to host ( besides fees that are paid), How to get a token to write in a customezed e-mail that amount is xxx to be payen on f.e.s (this bank account = vendor token)
-
Why
%vendor.bank_number%works in some emails but not in others — how to fix this.
I have tried this snippet:
add_filter(
'hivepress/v1/emails/booking_confirm_user',
function ( $email, $booking ) {
$listing = $booking->get_listing();
$vendor = $listing->get_vendor();
$vendor_user = $vendor->get_user();
$user = $booking->get_user();
// Beregn antal nætter
$start_date = strtotime( $booking->get_date( 'start' ) );
$end_date = strtotime( $booking->get_date( 'end' ) );
$nights = round( ( $end_date - $start_date ) / DAY_IN_SECONDS );
// Få totalbeløb fra booking
$total_amount = $booking->get_amount();
// Tilføj tokens
$email['tokens']['booking.nights'] = $nights;
$email['tokens']['booking.total_amount'] = hivepress()->helper->format_amount( $total_amount );
return $email;
},
10,
2
);
and this snippet
add_filter(
'hivepress/v1/emails/order_received',
function ( $email_args ) {
$booking = $email_args['tokens']['booking'];
if ( $booking ) {
$listing = $booking->get_listing();
$vendor = $listing->get_vendor();
$vendor_user = $vendor->get_user();
$user = $booking->get_user();
// Beregn nætter
$check_in = strtotime( $booking->get_start_date() );
$check_out = strtotime( $booking->get_end_date() );
$nights = round( ( $check_out - $check_in ) / ( 60 * 60 * 24 ) );
// Tokens
$email_args['tokens']['vendor'] = $vendor;
$email_args['tokens']['vendor_user'] = $vendor_user;
$email_args['tokens']['user'] = $user;
$email_args['tokens']['booking'] = $booking;
// Beregninger
$email_args['tokens']['booking_nights'] = $nights;
$email_args['tokens']['booking_total'] = $booking->get_amount();
$email_args['tokens']['booking_service_fee'] = $booking->get_fee_amount();
$email_args['tokens']['booking_direct_payment'] = $booking->get_amount();
// Custom attributter
$email_args['tokens']['vendor_phone'] = $vendor->get_attribute( 'phone' );
$email_args['tokens']['vendor_bank_number'] = $vendor->get_attribute( 'bank_number' );
}
return $email_args;
},
1000
);
I’ve tried to handle this myself for several weeks and tested everything inside the code reference and community forum. I really need a stable solution now before I go live.
Summary of mi questions:
1. A full list of HivePress emails (to both guest and host), in chronological order.
→ I need to know exactly which emails are triggered when, and which of them support custom object-based tokens like %vendor_user.email%, %booking.adults%, etc.
2. How to reliably add a %booking.nights% token.
→ I want to show guests the number of nights they booked, as a separate field (not just total amount divided by price). Right now, I can’t extract this info cleanly in emails.
3. How to calculate and display a custom token like %booking.remaining_to_host%.
→ It should calculate: booking total – service fee, so the guest knows how much to pay the host directly.
4. How to display amount + bank info for Direct Pay
→ I need a token that allows writing something like:
“Please pay €110 directly to this bank account: %vendor.bank_number% before your arrival.”
5. Why %vendor.bank_number% works in some emails but not others.
→ In booking_confirm_vendor and booking_confirm_user, it works fine (we used custom snippets with $vendor->get_attribute() logic).
But it doesn’t display in other emails like order_received or booking_requested — why not? How can I make it consistent?
We have already used snippets that define $vendor, $vendor_user, $booking, $user and made those tokens work in some emails. But I want to stabilize the system, make sure it works in the right emails, and avoid trial-and-error.
Can you help answer these questions and provide a clear recommendation?
Thank you ![]()
Thank you so much in advance!
Ewjgrass