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

/**
 * Plain Text Template: Service Hired Freelancer Email
 *
 * Sent to the freelancer when their service is hired.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $service_title
 * @var string   $employer_name
 * @var string   $employer_label
 * @var string   $service_id
 * @var string   $order_id
 * @var string   $total
 * @var string   $order_link
 * @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: Site title.
	esc_html__( 'Congratulations! Your service has been successfully hired on %s. The details of the new order are outlined below.', 'gigneo' ),
	esc_html( get_bloginfo( 'name' ) )
);
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";

/* Service ID */
echo esc_html__( 'Service ID:', 'gigneo' ) . ' ' . esc_html( gigneo_format_id( $service_id, 'service', false ) );
echo "\n";

/* Service title */
echo esc_html__( 'Service title:', 'gigneo' ) . ' ' . esc_html( $service_title );
echo "\n";

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

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

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

/* Closing note */
echo esc_html__( 'You can manage this order directly from your dashboard. Please make sure to communicate with the employer to ensure a smooth delivery.', 'gigneo' );
echo "\n\n";


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