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

/**
 * HTML Template: Service Order Revision Email
 *
 * Sent to the freelancer when the employer requests a revision.
 *
 * @var string   $email_heading
 * @var string   $profile_name
 * @var string   $employer_name
 * @var string   $service_title
 * @var string   $service_id
 * @var string   $order_id
 * @var string   $order_link
 * @var string   $employer_label
 * @var bool     $sent_to_admin
 * @var bool     $plain_text
 * @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
				printf(
					// translators: %s is the user's profile name.
					esc_html__( 'Hello %s,', 'gigneo' ),
					esc_html( $profile_name )
				);
				?>
			</p>

			<!-- Introduction -->
			<p style="margin: 0 0 30px 0;">
				<?php
				printf(
					// translators: %s: Employer name.
					esc_html__( '%s has requested a revision for your delivered service order. Please review the feedback and update your delivery as soon as possible.', 'gigneo' ),
					'<strong>' . esc_html( $employer_name ) . '</strong>'
				);
				?>
			</p>

			<!-- Section heading -->
			<h3 style="margin: 0 0 15px 0;">
				<?php echo esc_html__( 'Revision 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;">
				<!-- Order ID -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; width: 50%;">
						<?php echo esc_html__( 'Order ID', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( gigneo_format_id( $order_id, 'order', false ) ); ?>
					</td>
				</tr>

				<!-- Service ID -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0;">
						<?php echo esc_html__( 'Service ID', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( gigneo_format_id( $service_id, 'service', false ) ); ?>
					</td>
				</tr>

				<!-- Service title -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0;">
						<?php echo esc_html__( 'Service title', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $service_title ); ?>
					</td>
				</tr>

				<!-- Employer -->
				<tr>
					<td style="padding: 14px 16px;">
						<?php echo esc_html( $employer_label ); ?>
					</td>
					<td style="padding: 14px 16px; text-align: right;">
						<?php echo esc_html( $employer_name ); ?>
					</td>
				</tr>
			</table>

			<!-- 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_link ); ?>" target="_blank" rel="noopener">
							<?php echo esc_html__( 'Review revision', 'gigneo' ); ?> &rarr;
						</a>
					</td>
				</tr>
			</table>

			<!-- Closing note -->
			<p style="margin: 0 0 10px 0;">
				<?php echo esc_html__( 'Timely revisions help maintain high client satisfaction and ensure successful order completion.', 'gigneo' ); ?>
			</p>

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

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