src/Controller/DnsReportController.php (nouveau):
- Route /email/configuration/{token} accessible via le lien dans le mail
- Utilise le messageId de l'EmailTracking comme token d'acces
(seuls les destinataires du mail ont le lien)
- Execute tous les checks en temps reel: DnsCheckService (SPF, DMARC, MX,
Bounce via dig @1.1.1.1), AwsSesService (domaine, 3 DKIM CNAME,
MAIL FROM MX/TXT, bounce notif), CloudflareService (zone, records),
MailcowService (domaine, DKIM, MX, autodiscover, autoconfig, SRV, MTA-STS)
- Enrichit chaque check avec la colonne Cloudflare
- Passe les resultats au template Twig pour affichage complet
templates/dns_report/index.html.twig (nouveau):
- Page glassmorphism avec header glass
- Resume en haut: 3 cards (verifications OK, erreurs, avertissements)
avec bordures laterales colorees vert/rouge/jaune
- Tableau par domaine avec 6 colonnes: Source (badge colore par type:
orange AWS, violet Mailcow, bleu Cloudflare, gris DNS), Verification,
Attendu, Dig (actuel), Cloudflare, Statut (rond colore)
- Section erreurs detaillees avec liste
- Section avertissements avec liste
- Footer "Esy-Infra - Service de monitoring d'infra"
templates/emails/dns_report.html.twig (simplifie):
- Mail ne contient plus les details: seulement un tableau avec
chaque domaine et son statut (OK vert / WARN jaune / KO rouge)
- Bouton "Voir le rapport complet" avec lien vers la page web
(VML fallback pour Outlook)
- Le lien utilise le placeholder __DNS_REPORT_URL__ remplace par
le MailerService avec le messageId du mail
src/Service/MailerService.php:
- Ajout du remplacement de __DNS_REPORT_URL__ par l'URL absolue
/email/configuration/{messageId} dans sendEmail(), au meme
endroit que __VIEW_URL__
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
74 lines
4.5 KiB
Twig
74 lines
4.5 KiB
Twig
{% extends 'email/base.html.twig' %}
|
|
|
|
{% block title %}Rapport DNS - CRM SITECONSEIL{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{# ─── Bandeau statut ─── #}
|
|
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td align="center" style="background-color: {{ statusColor }}; color: #ffffff; padding-top: 10px; padding-bottom: 10px; padding-left: 16px; padding-right: 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;">
|
|
{{ statusText }}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h1 style="font-size: 18px; font-weight: 700; margin-top: 16px; margin-right: 0; margin-bottom: 8px; margin-left: 0;">Rapport DNS</h1>
|
|
<p style="font-size: 12px; color: #888888; margin-top: 0; margin-right: 0; margin-bottom: 16px; margin-left: 0;">
|
|
{{ date|date('d/m/Y H:i:s') }}
|
|
</p>
|
|
|
|
{# ─── Statut par domaine ─── #}
|
|
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #e5e5e5; margin-top: 0; margin-right: 0; margin-bottom: 16px; margin-left: 0;">
|
|
<tr>
|
|
<td style="background-color: #111827; color: #ffffff; padding-top: 8px; padding-bottom: 8px; padding-left: 12px; padding-right: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;">Domaine</td>
|
|
<td style="background-color: #111827; color: #ffffff; padding-top: 8px; padding-bottom: 8px; padding-left: 12px; padding-right: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; width: 80px;">Statut</td>
|
|
</tr>
|
|
{% for domainData in domainResults %}
|
|
{% set hasError = false %}
|
|
{% set hasWarning = false %}
|
|
{% for check in domainData.checks %}
|
|
{% if check.status == 'error' %}{% set hasError = true %}{% endif %}
|
|
{% if check.status == 'warning' %}{% set hasWarning = true %}{% endif %}
|
|
{% endfor %}
|
|
<tr>
|
|
<td style="padding-top: 10px; padding-bottom: 10px; padding-left: 12px; padding-right: 12px; font-size: 14px; font-weight: 700; border-bottom: 1px solid #eeeeee;">
|
|
{{ domainData.domain }}
|
|
</td>
|
|
<td style="padding-top: 10px; padding-bottom: 10px; padding-left: 12px; padding-right: 12px; font-size: 14px; font-weight: 700; text-align: center; border-bottom: 1px solid #eeeeee; color: {{ hasError ? '#dc2626' : (hasWarning ? '#f59e0b' : '#16a34a') }};">
|
|
{% if hasError %}
|
|
✗ KO
|
|
{% elseif hasWarning %}
|
|
⚠ WARN
|
|
{% else %}
|
|
✓ OK
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
|
|
{# ─── Lien vers le detail ─── #}
|
|
{% if reportUrl is defined and reportUrl %}
|
|
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-top: 16px; margin-right: 0; margin-bottom: 16px; margin-left: 0;">
|
|
<tr>
|
|
<td align="center" style="padding-top: 8px; padding-bottom: 8px;">
|
|
<!--[if mso]>
|
|
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" href="{{ reportUrl }}" style="height:44px;v-text-anchor:middle;width:320px;" arcsize="0%" fillcolor="#fabf04" stroke="f">
|
|
<center style="color:#111827;font-family:Arial,sans-serif;font-size:13px;font-weight:bold;text-transform:uppercase;letter-spacing:1px;">Voir le rapport complet</center>
|
|
</v:roundrect>
|
|
<![endif]-->
|
|
<!--[if !mso]><!-->
|
|
<a href="{{ reportUrl }}" style="display: inline-block; background-color: #fabf04; border: 1px solid #e5a800; padding-top: 12px; padding-bottom: 12px; padding-left: 32px; padding-right: 32px; color: #111827; font-weight: 700; text-transform: uppercase; font-size: 13px; text-decoration: none; letter-spacing: 1px;">Voir le rapport complet</a>
|
|
<!--<![endif]-->
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
{% endif %}
|
|
|
|
<p style="font-size: 11px; color: #888888; mso-line-height-rule: exactly; line-height: 16px; margin-top: 16px; margin-right: 0; margin-bottom: 0; margin-left: 0;">
|
|
Rapport par <strong>Esy-Infra</strong> - Service de monitoring d'infra
|
|
</p>
|
|
|
|
{% endblock %}
|