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

/**
 * Plain Text Template: Job Order Completed (Both Roles)
 *
 * Sent to both freelancer and employer when a job order is completed.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $freelancer_name
 * @var string   $employer_name
 * @var string   $job_title
 * @var int      $job_id
 * @var int      $order_id
 * @var string   $order_link
 * @var string   $employer_label
 * @var string   $freelancer_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( $recipient_name )
);
echo "\n\n";

/* Introduction */
printf(
	// translators: %s: Job title.
	esc_html__( 'Congratulations! The job order for "%s" has been successfully completed and closed. We hope you had a great experience working through our platform.', 'gigneo' ),
	esc_html( $job_title )
);
echo "\n\n";

/* Section heading */
echo esc_html__( 'Order summary', '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";

/* Employer label dynamic */
echo esc_html( $employer_label ) . ': ' . esc_html( $employer_name );
echo "\n";

/* Freelancer label dynamic */
echo esc_html( $freelancer_label ) . ': ' . esc_html( $freelancer_name );
echo "\n\n";

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

/* Closing note */
echo esc_html__( 'Don\'t forget to leave a review for the other party! Reviews help maintain a trustworthy community and reward great work.', 'gigneo' );
echo "\n\n";

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