<?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';
?>
<h1>Scan Could Not Complete</h1>

<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>
