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

/**
 * Plain Text Template: Job Order Review Email
 *
 * Sent to the user when they receive a review for a job order.
 *
 * @var string   $email_heading
 * @var string   $profile_name
 * @var string   $participant_name
 * @var string   $job_title
 * @var int      $job_id
 * @var int      $order_id
 * @var string   $order_link
 * @var string   $review_comment
 * @var float    $rating
 * @var int      $review_communication
 * @var int      $review_clarity
 * @var int      $review_professionalism
 * @var string   $reviewer_label
 * @var bool     $sent_to_admin
 * @var bool     $plain_text
 * @var WC_Email $email
 */

echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

/* Greeting */
printf(
	// translators: %s: Recipient name.
	esc_html__( 'Hello %s,', 'gigneo' ),
	esc_html( $participant_name )
);
echo "\n\n";

/* Introduction */
printf(
	// translators: %1$s: Reviewer name, %2$s: Reviewer label.
	esc_html__( 'You have received a new review from %1$s (%2$s). Feedback from your clients helps build trust and improve your professional profile.', 'gigneo' ),
	esc_html( $profile_name ),
	esc_html( $reviewer_label )
);
echo "\n\n";

/* Review Detail */
echo esc_html__( 'Overall Rating:', 'gigneo' ) . ' ' . number_format( $rating, 1 ) . '/5.0' . "\n";
echo esc_html__( 'Communication Level:', 'gigneo' ) . ' [*] ' . number_format( $review_communication, 1 ) . "\n";
echo esc_html__( 'Clarity of Requirements:', 'gigneo' ) . ' [*] ' . number_format( $review_clarity, 1 ) . "\n";
echo esc_html__( 'Professionalism:', 'gigneo' ) . ' [*] ' . number_format( $review_professionalism, 1 ) . "\n";
echo "----------------------------------------\n";
echo '"' . esc_html( wp_strip_all_tags( $review_comment ) ) . '"';
echo "\n----------------------------------------\n\n";

/* Section heading */
echo esc_html__( 'Order details', 'gigneo' );
echo "\n----------\n\n";

/* Order ID */
echo esc_html__( 'Order ID:', 'gigneo' ) . ' ' . esc_html( gigneo_format_id( $order_id, 'order', false ) );
echo "\n";

/* Job ID */
echo esc_html__( 'Job ID:', 'gigneo' ) . ' ' . esc_html( gigneo_format_id( $job_id, 'job', false ) );
echo "\n";

/* Job Title */
echo esc_html__( 'Job title:', 'gigneo' ) . ' ' . esc_html( $job_title );
echo "\n\n";

/* CTA link */
echo esc_html__( 'View review details:', 'gigneo' ) . ' ' . esc_url( $order_link );
echo "\n\n";

/* Closing note */
echo esc_html__( 'Feedback from your clients helps build trust and improve your professional profile.', 'gigneo' );
echo "\n\n";


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