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

/**
 * Plain Text Template: Account Closed Email
 *
 * Sent to the admin when a user permanently closes their account.
 *
 * @var string   $email_heading
 * @var string   $user_name
 * @var string   $user_email
 * @var int      $user_id
 * @var string   $site_title
 * @var string   $date_time
 * @var string   $reason
 * @var string   $detail
 * @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 */
echo esc_html__( 'Hello,', 'gigneo' );
echo "\n\n";

/* Introduction */
printf(
	// translators: %s: Site title.
	esc_html__( 'A user has permanently closed their account on %s. The details of this closure are outlined below.', 'gigneo' ),
	esc_html( $site_title )
);
echo "\n\n";

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

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

/* Email address */
echo esc_html__( 'Email address:', 'gigneo' ) . ' ' . esc_html( $user_email );
echo "\n";

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

/* Closed on */
echo esc_html__( 'Closed on:', 'gigneo' ) . ' ' . esc_html( $date_time );
echo "\n\n";

/* Additional detail (conditional) */
if ( ! empty( $detail ) ) {
	echo esc_html__( 'Additional detail:', 'gigneo' );
	echo "\n";
	echo esc_html( $detail );
	echo "\n\n";
}

/* CTA link */
echo esc_html__( 'View user:', 'gigneo' ) . ' ' . esc_url( get_edit_user_link( $user_id ) );
echo "\n\n";

/* Closing note */
echo esc_html__( 'You can review and manage this account from your WordPress admin dashboard.', 'gigneo' );
echo "\n\n";


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