{% extends "base.html" %} {% block content %}

Thread #{{ thread.id }}

Subject: {{ thread.subject }}

Account: {{ thread.account_email }}

{% if thread.requires_reply %} Needs reply {% else %} Up to date {% endif %}

AI Analysis

{% if ai %}

Actionable: {% if ai.actionable %}Yes{% else %}No{% endif %}

Summary: {{ ai.summary or "No summary available" }}

Confidence: {{ ai.confidence or "N/A" }}{% if ai.model %} • Model: {{ ai.model }}{% endif %}

{% if ai.analyzed_at %}

Analysis cached from: {{ ai.analyzed_at }}

{% elif thread.last_analyzed_at %}

Last analyzed: {{ thread.last_analyzed_at }}

{% endif %} {% else %}

No AI analysis available

{% endif %}

Last alert level sent: {{ thread.last_alert_level_sent }}{% if thread.last_alert_sent_at %} at {{ thread.last_alert_sent_at }}{% endif %}

Messages

{% for m in messages %}
{{ m.date_sent }} • {% if m.is_incoming %}Incoming{% else %}Outgoing{% endif %} • {{ m.folder }}
From: {{ m.from_email }} → To: {{ m.to_email }}
{{ m.subject }}
{{ m.body }}
{% else %}

No messages.

{% endfor %}
{% endblock %}