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

/**
 * HTML Template: Account Activated Email
 *
 * Sent to the admin when a user activates 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 bool     $sent_to_admin
 * @var bool     $plain_text
 * @var WC_Email $email
 */
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
do_action( 'woocommerce_email_header', $email_heading, $email );
?>

<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;">
	<tr>
		<td style="padding: 40px 20px;">

			<!-- Greeting -->
			<p style="padding: 0 0 0 0; margin: 0 0 20px 0;">
				<?php echo esc_html__( 'Hello,', 'gigneo' ); ?>
			</p>

			<!-- Introduction -->
			<p style="padding: 0 0 0 0; margin: 0 0 30px 0;">
				<?php
				printf(
					// translators: %s: Site title
					esc_html__( 'A user has activated their account on %s. The details are outlined below for your reference.', 'gigneo' ),
					'<strong>' . esc_html( $site_title ) . '</strong>'
				);
				?>
			</p>

			<!-- Section heading -->
			<h3 style="margin: 0 0 15px 0;">
				<?php echo esc_html__( 'Account details', 'gigneo' ); ?>
			</h3>

			<!-- Details table -->
			<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; background: #F7F7F7; border: 1px solid #f0f0f0; border-radius: 12px; margin: 0 0 36px 0;">
				<!-- Username -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; width: 50%;">
						<?php echo esc_html__( 'Username', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $user_name ); ?>
					</td>
				</tr>

				<!-- Email address -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0;">
						<?php echo esc_html__( 'Email address', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $user_email ); ?>
					</td>
				</tr>

				<!-- Activated on -->
				<tr>
					<td style="padding: 14px 16px;">
						<?php echo esc_html__( 'Activated on', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; text-align: right;">
						<?php echo esc_html( $date_time ); ?>
					</td>
				</tr>
			</table>

			<!-- CTA Button -->
			<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; margin: 0 0 36px 0;">
				<tr>
					<td style="text-align: center; padding: 0;">
						<a href="<?php echo esc_url( get_edit_user_link( $user_id ) ); ?>" target="_blank" rel="noopener">
							<?php echo esc_html__( 'View user', 'gigneo' ); ?> &rarr;
						</a>
					</td>
				</tr>
			</table>

			<!-- Closing note -->
			<p style="margin: 0 0 10px 0;">
				<?php echo esc_html__( 'You can review and manage this account from your WordPress admin dashboard.', 'gigneo' ); ?>
			</p>

		</td>
	</tr>
</table>

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