<?php
defined('ABSPATH') || exit;
/**
 * Booking approved notification.
 *
 * Expected variables:
 * - $owner, $service, $date, $provider
 * - Optional: $manage_booking_url, $add_to_calendar_url
 * - Optional: $date_to when using day interval
 */
$bookaro_subject = __( 'Your booking is approved', 'mybookaro' );
$bookaro_preheader = __( 'Your booking has been approved.', 'mybookaro' );
require bookaro_locate_template( 'templates/emails/partials/header.php' );
?>

<h2 style="font-size:20px; margin-bottom:12px;"><?php esc_html_e( 'Booking approved', '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, 4: provider */
    __( 'Hello %1$s, your booking for "%2$s" on %3$s has been approved by %4$s.', 'mybookaro' ),
    (string) $owner,
    (string) $service,
    (string) $bookaro_date_display,
    (string) $provider
);
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,
        esc_html__( 'Provider', 'mybookaro' ) => $provider,
    ];
}
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' ); ?>
