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

/**
 * Plain Text Template: New Job Proposal Submitted
 *
 * Sent to the employer when a new proposal is submitted.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $freelancer_name
 * @var string   $job_title
 * @var int      $proposal_id
 * @var int      $job_id
 * @var string   $proposal_link
 * @var string   $bid_amount
 * @var string   $job_delivery_time
 * @var string   $job_delivery_time_type
 * @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: Freelancer name, %2$s: Freelancer label, %3$s: Job title.
	esc_html__( 'You have received a new proposal from %1$s (%2$s) for your job posting "%3$s". Below are the key details of the proposal for your review.', 'gigneo' ),
	esc_html( $freelancer_name ),
	esc_html( $freelancer_label ),
	esc_html( $job_title )
);
echo "\n\n";

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

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

/* Freelancer label dynamic */
echo esc_html( $freelancer_label ) . ': ' . esc_html( $freelancer_name );
echo "\n";

/* Bid amount */
echo esc_html__( 'Bid amount:', 'gigneo' ) . ' ' . esc_html( gigneo_price_format( $bid_amount, true ) );
echo "\n";

/* Delivery time */
echo esc_html__( 'Estimated delivery:', 'gigneo' ) . ' ' . esc_html( $job_delivery_time . ' ' . $job_delivery_time_type );
echo "\n";

/* Proposal ID */
echo esc_html__( 'Proposal ID:', 'gigneo' ) . ' ' . esc_html( gigneo_format_id( $proposal_id, 'proposal', false ) );
echo "\n\n";

/* CTA link */
echo esc_html__( 'Review proposal details:', 'gigneo' ) . ' ' . esc_url( $proposal_link );
echo "\n\n";

/* Closing note */
echo esc_html__( 'We recommend reviewing the freelancer\'s profile and previous work before making a decision.', 'gigneo' );
echo "\n\n";


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