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

/**
 * HTML Template: Service Publish Request (Admin)
 *
 * Sent to the admin when a freelancer posts a new service that requires approval.
 *
 * @var string   $email_heading
 * @var string   $profile_name
 * @var string   $service_title
 * @var int      $service_id
 * @var string   $service_link
 * @var string   $admin_approval_link
 * @var string   $freelancer_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 echo esc_html__( 'Hello Admin,', 'gigneo' ); ?>
			</p>

			<!-- Introduction -->
			<p style="margin: 0 0 30px 0;">
				<?php
				printf(
					// translators: %1$s: Freelancer name, %2$s: Freelancer label, %3$s: Service title.
					esc_html__( 'A new service titled "%3$s" has been submitted by %1$s (%2$s) and is currently awaiting your approval.', 'gigneo' ),
					'<strong>' . esc_html( $profile_name ) . '</strong>',
					esc_html( $freelancer_label ),
					'<strong>' . esc_html( $service_title ) . '</strong>'
				);
				?>
			</p>

			<!-- Section heading -->
			<h3 style="margin: 0 0 15px 0;">
				<?php echo esc_html__( 'Service 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;">
				<!-- Service ID -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; width: 50%;">
						<?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>

				<!-- Submitted By -->
				<tr>
					<td style="padding: 14px 16px;">
						<?php echo esc_html__( 'Submitted by', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; text-align: right;">
						<?php echo esc_html( $profile_name ); ?> (<?php echo esc_html( $freelancer_label ); ?>)
					</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( $admin_approval_link ); ?>" target="_blank" rel="noopener">
							<?php echo esc_html__( 'Review and approve service', 'gigneo' ); ?> &rarr;
						</a>
					</td>
				</tr>
			</table>

			<!-- Preview link -->
			<p style="margin: 0 0 10px 0;">
				<?php echo esc_html__( 'You can also preview the service live before approving by clicking the link below:', 'gigneo' ); ?><br>
				<a href="<?php echo esc_url( $service_link ); ?>" style="color: #6C5CE7; text-decoration: underline;"><?php echo esc_url( $service_link ); ?></a>
			</p>

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

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