1
0
Files
breadcrumb-the-shire/pages/admin/mail-log/view(default).phtml
2026-02-04 23:31:53 +01:00

137 lines
4.5 KiB
PHTML

<?php
/**
* @var array $mailLog
*/
$mailLog = $mailLog ?? [];
$status = (string) ($mailLog['status'] ?? '');
$statusBadge = 'neutral';
if ($status === 'sent') {
$statusBadge = 'success';
} elseif ($status === 'failed') {
$statusBadge = 'danger';
}
?>
<div class="app-details-container">
<section>
<div class="app-breadcrumb">
<a href="/admin">Startseite</a><i class="bi bi-chevron-right"></i><a
href="/admin/mail-log"><?php e(t('Mail logs')); ?></a><i class="bi bi-chevron-right"></i><?php e(t('View')); ?>
</div>
<div class="app-details-titlebar">
<h1>
<a href="admin/mail-log" title="<?php e(t('Back')); ?>"><i class="bi bi-arrow-left"></i></a>
<?php e(t('View mail log')); ?>
</h1>
</div>
<div class="app-details-content">
<details open>
<summary><?php e(t('Email details')); ?></summary>
<hr>
<div class="app-details-section">
<div class="grid">
<div class="app-form-group">
<label><?php e(t('Recipient')); ?></label>
<input type="text" value="<?php e($mailLog['to_email'] ?? ''); ?>" readonly>
</div>
<div class="app-form-group">
<label><?php e(t('Subject')); ?></label>
<input type="text" value="<?php e($mailLog['subject'] ?? ''); ?>" readonly>
</div>
</div>
<div class="app-form-group">
<label><?php e(t('Template')); ?></label>
<input type="text" value="<?php e($mailLog['template'] ?? '-'); ?>" readonly>
</div>
</div>
</details>
<?php if ($status === 'sent'): ?>
<hr>
<details open>
<summary><?php e(t('Delivery information')); ?></summary>
<hr>
<div class="app-details-section">
<div class="app-form-group">
<label><?php e(t('Sent at')); ?></label>
<input type="text" value="<?php e(dt($mailLog['sent_at'] ?? '')); ?>" readonly>
</div>
<?php if (!empty($mailLog['provider_message_id'])): ?>
<div class="app-form-group">
<label><?php e(t('Provider message ID')); ?></label>
<input type="text" value="<?php e($mailLog['provider_message_id'] ?? ''); ?>" readonly>
</div>
<?php endif; ?>
</div>
</details>
<?php endif; ?>
<?php if ($status === 'failed' && !empty($mailLog['error_message'])): ?>
<hr>
<details open>
<summary><?php e(t('Error information')); ?></summary>
<hr>
<div class="app-details-section">
<div class="app-form-group">
<label><?php e(t('Error message')); ?></label>
<textarea readonly rows="6"><?php e($mailLog['error_message'] ?? ''); ?></textarea>
</div>
</div>
</details>
<?php endif; ?>
</div>
</section>
<aside id="app-details-aside-section">
<div class="app-details-aside-section">
<hgroup>
<strong><?php e($mailLog['to_email'] ?? ''); ?></strong>
<p><small><?php e(t('Mail log')); ?></small></p>
</hgroup>
<hr>
<div class="grid">
<div>
<small><?php e(t('ID')); ?></small>
<p>
<span class="badge" data-variant="neutral">
<?php e($mailLog['id'] ?? '-'); ?>
</span>
</p>
</div>
<div>
<small>
<?php e(t('Status')); ?>
</small>
<div>
<span class="badge" data-variant="<?php e($statusBadge); ?>">
<?php e(t(ucfirst($status))); ?>
</span>
</div>
</div>
</div>
<div>
<small><?php e(t('Created')); ?></small>
<p><?php e(dt($mailLog['created_at'] ?? '') ?: '-'); ?></p>
</div>
<?php if ($status === 'sent' && !empty($mailLog['sent_at'])): ?>
<div>
<small><?php e(t('Sent')); ?></small>
<p><?php e(dt($mailLog['sent_at'] ?? '') ?: '-'); ?></p>
</div>
<?php endif; ?>
<?php if (!empty($mailLog['provider_message_id'])): ?>
<div class="grid">
<div>
<small><?php e(t('Provider message ID')); ?></small>
<span class="badge" data-copy="true" data-copy-value="<?php e($mailLog['provider_message_id']); ?>"
data-variant="neutral"><?php e(substr($mailLog['provider_message_id'], 0, 20)); ?></span>
</div>
</div>
<?php endif; ?>
</div>
</aside>
</div>