<?php
/**
 * @var string $content
 * @var string $avatar_url
 * @var string $user_display_name
 */

use GemBoards\Utils\Helper;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
} // if accessed directly, exit ?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">

	<?php Helper::get_template( 'emails/style.php' ); ?>
</head>
<body>
<div class="gemboards_email_notification">
	<div class="gemboards_email_notification_top">
		<div class="gemboards_email_notification_head">
			<?php
			$boards_email_header = '';
			$site_logo           = get_site_icon_url( 128 );
			$site_title          = get_bloginfo( 'name' );

			if ( $site_logo ) {
				$boards_email_header .= '<img src="' . esc_url( $site_logo ) . '" width="100px" alt="' . esc_attr( $site_title ) . '">';
			} else {
				$boards_email_header .= '<div class="gemboards_head_text">' . esc_html( $site_title ) . '</div>';
			}

			// Apply the filter to the email header
			$boards_email_header = apply_filters( 'gemboards/email_header', $boards_email_header );
			// Output the final email header (allow safe HTML)
			echo wp_kses_post( $boards_email_header );
			?>
		</div>
		<div class="gemboards_email_notification_contents">
			<div class="gemboards_email_content">
				<div class="gemboards_email_content_left">
					<img src="<?php echo esc_url( $avatar_url ); ?>" alt="<?php echo esc_attr( $user_display_name ); ?>" class="gemboards-avatar">
				</div>
				<div class="gemboards_email_content_right">
					<p class="gemboards_user_name"><?php echo esc_html( $user_display_name ); ?></p>
					<?php echo wp_kses_post( $content ); ?>
				</div>
			</div>
		</div>
		<div class="gemboards_email_notification_bottom">
			<?php if ( ! Helper::has_pro() ) : ?>
				<span class="gemboards_email_footer_text"><?php esc_html_e( 'Powered By', 'gemboards' ); ?>
					<strong style="color: #388BFF"><a
								href="https://gemboards.com?utm_source=wp&utm_medium=wp_mail&utm_campaign=footer">GemBoards</a> </strong>
				</span>
			<?php endif; ?>
		</div>
	</div>

	<?php
	$footer_content = apply_filters( 'gemboards/email_footer', '' );
	if ( ! empty( $footer_content ) ) :
		?>
		<div class="gemboards_email_notification_footer">
			<?php echo wp_kses_post( $footer_content ); ?>
		</div>
	<?php endif; ?>
</div>
</body>
</html>
