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

/**
 * Plain Text Template: Service Order Cancel Response
 *
 * Sent to the other party when a cancellation request is responded to.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $responder_name
 * @var string   $service_title
 * @var string   $service_id
 * @var string   $order_id
 * @var string   $order_link
 * @var string   $status
 * @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: Responder name, %2$s: Status (Approved/Declined).
	esc_html__( '%1$s has responded to the service order cancellation request. The request has been %2$s.', 'gigneo' ),
	esc_html( $responder_name ),
	esc_html( strtolower( $status ) )
);
echo "\n\n";

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

/* Status */
echo esc_html__( 'Request status:', 'gigneo' ) . ' ' . esc_html( $status );
echo "\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";

/* Responded by */
echo esc_html__( 'Responded by:', 'gigneo' ) . ' ' . esc_html( $responder_name );
echo "\n\n";

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

/* Closing note */
if ( strtolower( $status ) === 'approved' ) {
	echo esc_html__( 'The order has been successfully cancelled and any applicable refunds have been initiated.', 'gigneo' );
} else {
	echo esc_html__( 'Since the request was declined, the order will continue as planned. Please communicate with the other party to resolve any issues.', 'gigneo' );
}
echo "\n\n";


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