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

/**
 * Plain Text Template: Job Hired (Freelancer Notification)
 *
 * Sent to the freelancer when they are hired for a job.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $job_title
 * @var string   $employer_name
 * @var int      $job_id
 * @var int      $order_id
 * @var string   $total
 * @var string   $employer_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: %1$s: Employer name, %2$s: Employer label, %3$s: Job title.
	esc_html__( 'Congratulations! You have been hired by %1$s (%2$s) for the job "%3$s". A new order has been created, and you can now start working on this project.', 'gigneo' ),
	esc_html( $employer_name ),
	esc_html( $employer_label ),
	esc_html( $job_title )
);
echo "\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";

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

/* Total budget */
echo esc_html__( 'Total budget:', 'gigneo' ) . ' ' . esc_html( gigneo_price_format( $total, true ) );
echo "\n\n";

/* CTA link */
echo esc_html__( 'View order and start work:', 'gigneo' ) . ' ' . esc_url( gigneo_dashboard_url( 'order', 'job-detail', array( 'p_id' => $order_id ) ) );
echo "\n\n";

/* Closing note */
echo esc_html__( 'Please ensure you follow the project requirements and maintain clear communication with the employer throughout the project.', 'gigneo' );
echo "\n\n";

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