WizdomWeb/resources/views/emails/system_alert.php

58 lines
1.9 KiB
PHP

<?php
/**
* File: system_alert.php
* Path: /resources/views/emails/system_alert.php
* Template Name: System Alert Email
* Purpose: Sent to admins when a critical error or exception occurs.
* Triggered By: EmailHelper::alertAdmins()
* Project: Wizdom Networks Website
*/
/** @var string $context */
/** @var string $errorMessage */
/** @var array|string $data */
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>System Alert</title>
<style>
body { font-family: Arial, sans-serif; background: #f9f9f9; color: #333; padding: 30px; }
.container { background: #fff; border: 1px solid #ddd; padding: 25px; max-width: 720px; margin: auto; border-radius: 6px; }
h1 { color: #d32f2f; }
pre { background: #f1f1f1; padding: 12px; border-left: 4px solid #ccc; overflow-x: auto; }
ul { margin-top: 0; }
li { margin-bottom: 8px; }
.footer { font-size: 0.85em; color: #777; margin-top: 40px; }
</style>
</head>
<body>
<div class="container">
<h1>🚨 System Alert: <?= htmlspecialchars($context ?? 'Unknown') ?></h1>
<p><strong>Error Message:</strong></p>
<pre><?= htmlspecialchars($errorMessage ?? 'N/A') ?></pre>
<?php if (!empty($data)): ?>
<p><strong>Contextual Data:</strong></p>
<ul>
<?php if (is_array($data)): ?>
<?php foreach ($data as $key => $value): ?>
<li><strong><?= htmlspecialchars($key) ?>:</strong> <?= nl2br(htmlspecialchars((string)$value)) ?></li>
<?php endforeach; ?>
<?php else: ?>
<li><?= nl2br(htmlspecialchars($data)) ?></li>
<?php endif; ?>
</ul>
<?php endif; ?>
<p class="footer">
This alert was generated by the Wizdom Networks website infrastructure.
</p>
</div>
</body>
</html>