<?php
defined('ABSPATH') || exit;
/**
 * 24-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 tomorrow', 'mybookaro' );
$bookaro_preheader = __( 'Your booking starts tomorrow.', '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, this is a reminder that your booking for "%2$s" is scheduled for %3$s.', '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' ); ?>
