<?php

/**
 * Scan failure email template.
 *
 * Variables via $data array:
 * - $data['site_name'], $data['site_url'], $data['label']
 * - $data['message'] (string - user-facing error description)
 * - $data['scan_id'] (string, optional)
 */

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

$sitefort_message = $data['message'] ?? 'The scan could not complete. Please try again later.';
$sitefort_scan_id = $data['scan_id'] ?? '';
$sitefort_brand_name = isset( $data['brand_name'] ) && is_scalar( $data['brand_name'] )
    ? sanitize_text_field( (string) $data['brand_name'] )
    : 'SiteFort';
$sitefort_site_name = isset( $data['site_name'] ) && is_scalar( $data['site_name'] )
    ? sanitize_text_field( (string) $data['site_name'] )
    : 'your site';
?>
<h1>Scan Could Not Complete</h1>

<p class="intro-copy">
    <?php echo esc_html( $sitefort_brand_name ); ?> could not finish the security scan on <?php echo esc_html( $sitefort_site_name ); ?>.
</p>

<div class="alert-warn">
    <?php echo esc_html( $sitefort_message ); ?>
</div>

<div class="detail-box">
    <strong>Site:</strong> <?php echo esc_html( $data['site_url'] ?? '' ); ?><br>
    <?php if ( $sitefort_scan_id ) : ?>
    <strong>Reference:</strong> <span style="font-family: ui-monospace, monospace; font-size: 13px;"><?php echo esc_html( $sitefort_scan_id ); ?></span>
    <?php endif; ?>
</div>

<p>
    This is usually a temporary issue. If the problem persists,
    check your <?php echo esc_html( $sitefort_brand_name ); ?> dashboard or contact support.
</p>
