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

/**
 * Plain Text Template: Withdraw Response Email
 *
 * Sent to the user when their withdrawal request is processed.
 *
 * @var string   $email_heading
 * @var WC_Email $email
 * @var string   $withdrawal_id
 * @var string   $withdrawal_status
 * @var string   $withdrawal_amount
 * @var string   $withdrawal_note
 * @var string   $withdrawal_date
 * @var string   $withdrawal_updated
 * @var string   $payment_method
 * @var string   $payout_fee
 * @var string   $fee_label
 * @var string   $net_amount
 * @var string   $payout_tax
 * @var string   $payable_amount
 * @var string   $profile_id
 * @var string   $profile_name
 * @var string   $moderator_name
 * @var string   $site_name
 * @var bool     $sent_to_admin
 * @var bool     $plain_text
 */

echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

/* Greeting */
printf(
	// translators: %s: Profile name.
	esc_html__( 'Hello %s,', 'gigneo' ),
	esc_html( $profile_name )
);
echo "\n\n";

/* Introduction */
printf(
	// translators: %1$s: Moderator name, %2$s: Withdrawal status.
	esc_html__( 'Your withdrawal request has been reviewed by %1$s and has been marked as %2$s. The details are outlined below.', 'gigneo' ),
	esc_html( $moderator_name ),
	esc_html( $withdrawal_status )
);
echo "\n\n";

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

/* Request ID */
echo esc_html__( 'Request ID:', 'gigneo' ) . ' ' . esc_html( gigneo_format_id( $withdrawal_id, 'withdraw', false ) );
echo "\n";

/* Status */
echo esc_html__( 'Status:', 'gigneo' ) . ' ' . esc_html( $withdrawal_status );
echo "\n";

/* Amount requested */
echo esc_html__( 'Amount requested:', 'gigneo' ) . ' ' . esc_html( wp_strip_all_tags( $withdrawal_amount ) );
echo "\n";

/* Fee */
echo esc_html( $fee_label ) . ': ' . esc_html( wp_strip_all_tags( $payout_fee ) );
echo "\n";

/* Net amount */
echo esc_html__( 'Net amount:', 'gigneo' ) . ' ' . esc_html( wp_strip_all_tags( $net_amount ) );
echo "\n";

/* Tax deduction */
echo esc_html__( 'Tax deduction:', 'gigneo' ) . ' ' . esc_html( wp_strip_all_tags( $payout_tax ) );
echo "\n";

/* Payable amount */
echo esc_html__( 'Payable amount:', 'gigneo' ) . ' ' . esc_html( wp_strip_all_tags( $payable_amount ) );
echo "\n";

/* Payout method */
echo esc_html__( 'Payout method:', 'gigneo' ) . ' ' . esc_html( wp_strip_all_tags( $payment_method ) );
echo "\n";

/* Request date */
echo esc_html__( 'Request date:', 'gigneo' ) . ' ' . esc_html( $withdrawal_date );
echo "\n";

/* Last updated */
echo esc_html__( 'Last updated:', 'gigneo' ) . ' ' . esc_html( $withdrawal_updated );
echo "\n\n";

/* Admin note (conditional) */
if ( ! empty( $withdrawal_note ) ) {
	echo esc_html__( 'Admin note:', 'gigneo' );
	echo "\n";
	echo esc_html( wp_strip_all_tags( $withdrawal_note ) );
	echo "\n\n";
}

/* CTA link */
echo esc_html__( 'View your wallet:', 'gigneo' ) . ' ' . esc_url( gigneo_dashboard_url( 'account', 'wallet' ) );
echo "\n\n";

/* Closing note */
echo esc_html__( 'All transactions can be viewed in the wallet section of your profile.', 'gigneo' );
echo "\n\n";

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