<?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;
}

$securwp_message = $data['message'] ?? 'The scan could not complete. Please try again later.';
$securwp_scan_id = $data['scan_id'] ?? '';
$securwp_brand_name = isset( $data['brand_name'] ) && is_scalar( $data['brand_name'] )
    ? sanitize_text_field( (string) $data['brand_name'] )
    : 'securwp';
?>
<h1>Scan Could Not Complete</h1>

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

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

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