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

/**
 * Plain Text Template: Job Rejected Email
 *
 * Sent to the employer when their job is rejected.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $job_title
 * @var int      $job_id
 * @var string   $job_link
 * @var string   $reject_reason
 * @var string   $reject_type
 * @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: Job title.
	esc_html__( 'Thank you for submitting your job posting for "%s". After a careful review, our moderation team has decided not to approve it at this time.', 'gigneo' ),
	esc_html( $job_title )
);
echo "\n\n";

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

/* Job Title */
echo esc_html__( 'Job title:', 'gigneo' ) . ' ' . esc_html( $job_title );
echo "\n";

/* Job ID */
echo esc_html__( 'Job ID:', 'gigneo' ) . ' ' . esc_html( gigneo_format_id( $job_id, 'job', false ) );
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 and resubmit:', 'gigneo' ) . ' ' . esc_url( gigneo_dashboard_url( 'job', 'edit', array( 'p_id' => $job_id ) ) );
	echo "\n\n";
}



/* Closing note */
echo esc_html__( 'You can update your job posting to comply with our guidelines and resubmit it for review. We look forward to seeing your project live!', 'gigneo' );
echo "\n\n";

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