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

/**
 * Plain Text Template: Service Rejected
 *
 * Sent to the freelancer when their service is rejected by an admin.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $service_title
 * @var int      $service_id
 * @var string   $service_link
 * @var string   $reject_reason
 * @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: Service title.
	esc_html__( 'We regret to inform you that your service "%s" has been rejected during our moderation process.', 'gigneo' ),
	esc_html( $service_title )
);
echo "\n\n";

/* Section heading */
echo esc_html__( 'Service summary', 'gigneo' );
echo "\n----------\n\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\n";

/* Rejection Reason */
if ( ! empty( $reject_reason ) || ! empty( $reject_type ) ) {
	echo esc_html__( 'Rejection type:', 'gigneo' ) . "\n";
	echo esc_html( $reject_type ) . "\n\n";

	echo esc_html__( 'Reason for rejection:', 'gigneo' ) . "\n";
	echo esc_html( $reject_reason ) . "\n\n";

	/* CTA link */
	echo esc_html__( 'Edit service and resubmit:', 'gigneo' ) . ' ' . esc_url( gigneo_dashboard_url( 'service', 'edit', array( 'p_id' => $service_id ) ) );
	echo "\n\n";
}


/* Closing note */
echo esc_html__( 'Please review our community guidelines and update your service accordingly before resubmitting for approval.', 'gigneo' );
echo "\n\n";


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