<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * ============================================
 * FILE: templates/emails/customer/event-registration-confirmed.php
 * Customer Event Registration Confirmed Email Template
 * ============================================
 */

// Get email header
do_action( 'rtrb_get_email_header', $email, $booking );

/**
* Hook: rtrb_email_before_content
*
* @hooked TemplateHooks::email_heading - 10
*/
do_action( 'rtrb_email_before_content', $email, $booking );

/**
* Hook: rtrb_email_content_start
*/
do_action( 'rtrb_email_content_start', $email, $booking );
?>

<!-- Email Content Text -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="main-content">
			<?php if ( ! empty( $settings['additional_content'] ) ) : ?>
				<?php echo wp_kses_post( wpautop( wptexturize( $settings['additional_content'] ) ) ); ?>
			<?php else : ?>
				<p style="margin: 0;"><?php esc_html_e( 'Great news! Your event registration has been confirmed. Here are your event details:', 'radius-booking' ); ?></p>
			<?php endif; ?>
		</td>
	</tr>
</table>

<?php
/**
 * Hook: rtrb_email_before_booking_details
 */
do_action( 'rtrb_email_before_booking_details', $email, $booking );
?>

<?php require __DIR__ . '/../partials/event-details-block.php'; ?>

<?php
/**
 * Hook: rtrb_email_after_booking_details
 */
do_action( 'rtrb_email_after_booking_details', $email, $booking );
?>

<!-- Status Badge -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="center" style="padding: 16px 0;">
			<span style="background-color: #d1fae5; color: #065f46; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block;">
				<?php esc_html_e( 'REGISTRATION CONFIRMED', 'radius-booking' ); ?>
			</span>
		</td>
	</tr>
</table>

<?php if ( ! empty( $settings['footer_text'] ) ) : ?>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td class="footer-text">
				<?php
				echo wp_kses_post(
					wpautop(
						wptexturize( $settings['footer_text'] )
					)
				);
				?>
			</td>
		</tr>
	</table>
<?php endif; ?>

<?php
/**
 * Hook: rtrb_email_before_button
 */
do_action( 'rtrb_email_before_button', $email, $booking );
?>

<?php if ( ! empty( $settings['button_text'] ) ) : ?>
	<!-- Button -->
	<?php
	/**
	 * Hook: rtrb_email_button
	 *
	 * @hooked TemplateHooks::email_button - 10
	 */
	do_action( 'rtrb_email_button', $email, $booking, $settings );
	?>
<?php endif; ?>

<?php
/**
 * Hook: rtrb_email_content_end
 */
do_action( 'rtrb_email_content_end', $email, $booking );
?>

<?php
/**
 * Hook: rtrb_email_after_content
 *
 * @hooked TemplateHooks::email_booking_id - 10
 */
do_action( 'rtrb_email_after_content', $email, $booking );

// Get email footer
do_action( 'rtrb_get_email_footer', $email, $booking );
?>
