<?php
defined('ABSPATH') || exit;
/**
 * 1-hour booking reminder.
 *
 * Expected variables:
 * - $owner, $service, $date
 * - Optional: $manage_booking_url, $add_to_calendar_url
 * - Optional: $date_to when using day interval
 */
$bookaro_subject = __( 'Reminder: your booking is in 1 hour', 'mybookaro' );
$bookaro_preheader = __( 'Your booking starts in one hour.', 'mybookaro' );
require bookaro_locate_template( 'templates/emails/partials/header.php' );
?>

<h2 style="font-size:20px; margin-bottom:12px;"><?php esc_html_e( 'Upcoming booking reminder', 'mybookaro' ); ?></h2>
<?php
$bookaro_date_display = $date;
if ( ! empty( $date_to ) ) {
    $bookaro_date_display = sprintf(
        /* translators: 1: start date, 2: end date */
        __( '%1$s to %2$s', 'mybookaro' ),
        $date,
        $date_to
    );
}
$bookaro_intro_fallback = sprintf(
    /* translators: 1: owner, 2: service, 3: date or range */
    __( 'Hello %1$s, just a heads-up: your booking for "%2$s" starts at %3$s. Looking forward to seeing you!', 'mybookaro' ),
    (string) $owner,
    (string) $service,
    (string) $bookaro_date_display
);
require bookaro_locate_template( 'templates/emails/partials/intro.php' );
?>
<?php
$bookaro_details = isset( $bookaro_details ) && is_array( $bookaro_details ) ? $bookaro_details : [];
if ( empty( $bookaro_details ) ) {
    $bookaro_details = [
        esc_html__( 'Service', 'mybookaro' ) => $service,
        esc_html__( 'Date', 'mybookaro' )    => $bookaro_date_display,
    ];
}
require bookaro_locate_template( 'templates/emails/partials/booking-details.php' );
require bookaro_locate_template( 'templates/emails/partials/contact-details.php' );
require bookaro_locate_template( 'templates/emails/partials/timezone.php' );
require bookaro_locate_template( 'templates/emails/partials/policy-snippet.php' );
require bookaro_locate_template( 'templates/emails/partials/booking-actions.php' );
?>

<?php require bookaro_locate_template( 'templates/emails/partials/footer.php' ); ?>
