<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
/**
 * HTML Template: Order Extend Delivery Email
 *
 * Sent to the employer when their order delivery date is extended.
 *
 * @var string   $email_heading
 * @var string   $freelancer_name
 * @var int      $order_id
 * @var string   $old_delivery_date
 * @var string   $new_delivery_date
 * @var string   $reason
 * @var string   $order_url
 * @var WC_Email $email
 */
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
do_action( 'woocommerce_email_header', $email_heading, $email );
?>

<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;">
	<tr>
		<td style="padding: 40px 20px;">

			<!-- Greeting -->
			<p style="margin: 0 0 20px 0;">
				<?php echo esc_html__( 'Hello there,', 'gigneo' ); ?>
			</p>

			<!-- Introduction -->
			<p style="margin: 0 0 30px 0;">
				<?php
				printf(
					// translators: %1$s is a freelancer name, %2$s is an order ID.
					esc_html__( '%1$s send you request for extend delivery date of the order ID %2$s.', 'gigneo' ),
					'<strong>' . esc_html( $freelancer_name ) . '</strong>',
					'<strong>' . esc_html( gigneo_format_id( $order_id, 'order', false ) ) . '</strong>'
				);
				?>
			</p>

			<!-- Section heading -->
			<h3 style="margin: 0 0 15px 0;">
				<?php echo esc_html__( 'Request details', 'gigneo' ); ?>
			</h3>

			<!-- Details table -->
			<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; background: #F7F7F7; border: 1px solid #f0f0f0; border-radius: 12px; margin: 0 0 30px 0;">
				<!-- Old Delivery Date -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; width: 50%;">
						<?php echo esc_html__( 'Old Delivery Date', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $old_delivery_date ); ?>
					</td>
				</tr>

				<!-- New Delivery Date -->
				<tr>
					<td style="padding: 14px 16px;">
						<?php echo esc_html__( 'New Delivery Date', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; text-align: right;">
						<?php echo esc_html( $new_delivery_date ); ?>
					</td>
				</tr>
			</table>

			<?php if ( ! empty( $reason ) ) : ?>
				<!-- Message Section -->
				<h3 style="margin: 0 0 15px 0;">
					<?php echo esc_html__( 'Message', 'gigneo' ); ?>
				</h3>
				<div style="background: #ffffff; border: 1px solid #f0f0f0; border-radius: 12px; padding: 20px; margin: 0 0 30px 0; color: #636363; font-size: 15px; font-style: italic; line-height: 1.6; text-align: left;">
					<?php echo wp_kses( $reason, gigneo_allowed_html_tags() ); ?>
				</div>
			<?php endif; ?>

			<!-- CTA Button -->
			<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; margin: 0 0 30px 0;">
				<tr>
					<td style="text-align: center; padding: 10px 0;">
						<a href="<?php echo esc_url( $order_url ); ?>" target="_blank" rel="noopener">
							<?php echo esc_html__( 'Click Here', 'gigneo' ); ?> &rarr;
						</a>
					</td>
				</tr>
			</table>

			<!-- Closing note -->
			<p style="margin: 0 0 10px 0;">
				<?php echo esc_html__( 'To edit user access and details click the button above.', 'gigneo' ); ?>
			</p>

		</td>
	</tr>
</table>

<?php
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
do_action( 'woocommerce_email_footer', $email );