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

/**
 * Plain Text Template: Service Order Cancel Request
 *
 * Sent to the other party when a cancellation is requested.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $requester_name
 * @var string   $service_title
 * @var int      $service_id
 * @var int      $order_id
 * @var string   $cancel_reason
 * @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: %1$s: Requester name, %2$s: Service title.
	esc_html__( '%1$s has requested to cancel the service order for "%2$s". Please review the request and respond accordingly.', 'gigneo' ),
	esc_html( $requester_name ),
	esc_html( $service_title )
);
echo "\n\n";

/* Section heading */
echo esc_html__( 'Request 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 title */
echo esc_html__( 'Service title:', 'gigneo' ) . ' ' . esc_html( $service_title );
echo "\n";

/* Reason */
echo esc_html__( 'Reason for cancellation:', 'gigneo' ) . ' ' . esc_html( $cancel_reason );
echo "\n\n";

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

/* Closing note */
echo esc_html__( 'You can either approve or decline this cancellation request from your dashboard. If no action is taken within the allowed time frame, the request may be automatically processed.', 'gigneo' );
echo "\n\n";


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