<?php
/**
 * Abandoned cart recovery email.
 *
 * This template can be overridden by copying it to yourtheme/cartninja/emails/cartninja-abandoned-cart.php.
 *
 * @package CartNinjaRecovery
 */

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

do_action( 'woocommerce_email_header', $email_heading, $email );
?>

<?php echo wp_kses_post( wpautop( wptexturize( $message ) ) ); ?>

<?php
if ( function_exists( 'wc_get_template' ) ) {
	wc_get_template(
		'emails/cartninja-cart-items.php',
		array(
			'cart_items' => $cart_items,
			'cart_total' => $cart_total,
		),
		'cartninja/',
		CARTNINJA_PLUGIN_DIR . 'templates/'
	);
}
?>

<p style="text-align:center; margin: 32px 0;">
	<a href="<?php echo esc_url( $cart_url ); ?>" style="background-color:#0EA5A0; border-radius:4px; color:#ffffff; display:inline-block; font-weight:600; line-height:1.2; padding:14px 24px; text-decoration:none;">
		<?php echo esc_html( $button_text ); ?>
	</a>
</p>

<?php if ( ! empty( $coupon_code ) ) : ?>
	<p>
		<?php
		echo wp_kses_post(
			sprintf(
				/* translators: %s: coupon code */
				__( 'Use coupon code %s at checkout.', 'cartninja-recovery-for-woocommerce' ),
				'<strong>' . esc_html( $coupon_code ) . '</strong>'
			)
		);
		?>
	</p>
<?php endif; ?>

<?php if ( ! empty( $additional_content ) ) : ?>
	<?php echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); ?>
<?php endif; ?>

<?php
do_action( 'woocommerce_email_footer', $email );
