<?php
/**
 * Subscription confirmed email template.
 *
 * Available variables:
 *   $email_heading   - Email heading text.
 *   $product_name    - Product name.
 *   $product_url     - Product permalink.
 *   $site_name       - Site name.
 *   $unsubscribe_url - Unsubscribe link URL.
 *   $email           - WC_Email object or null.
 *
 * @package Waitlytics
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
do_action( 'woocommerce_email_header', $email_heading, $email );
?>

<p><?php
	printf(
		/* translators: %s: product name */
		esc_html__( "You've been added to the waitlist for %s.", 'waitlytics' ),
		esc_html( $product_name )
	);
?></p>

<p><?php esc_html_e( "We'll send you an email as soon as it's back in stock. No need to keep checking — we've got you covered.", 'waitlytics' ); ?></p>

<div style="text-align: center; margin: 25px 0;">
	<a href="<?php echo esc_url( $product_url ); ?>"
	   style="background: #0073aa; color: #ffffff; padding: 12px 30px; text-decoration: none; border-radius: 4px; font-size: 16px; display: inline-block;">
		<?php esc_html_e( 'View Product', 'waitlytics' ); ?>
	</a>
</div>

<p style="font-size: 12px; color: #666; text-align: center; margin-top: 30px;">
	<?php
	printf(
		wp_kses(
			/* translators: %s: unsubscribe URL */
			__( 'Changed your mind? <a href="%s" style="color: #666;">Unsubscribe</a>', 'waitlytics' ),
			array(
				'a' => array(
					'href'  => array(),
					'style' => array(),
				),
			)
		),
		esc_url( $unsubscribe_url )
	);
	?>
</p>

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