{# _email_action_result.html — rendered by email action routes (test, list, fetch, auth-status) Expects: `outcome` dict with keys: ok (bool) — success/failure detail (str) — message or error text rows (list[dict]) — optional message rows for list action kind (str, optional) — "auth" for oauth polling state state (str, optional) — "running" | "done" | "error" for auth account (str, optional) — account name, for auth polling URL verification_uri (str, optional) user_code (str, optional) #} {% set kind = outcome.get("kind", "") %} {% set state = outcome.get("state", "") %} {% if kind == "auth" and state == "running" %} {# OAuth running — show device-code prompt if available #} {% set uri = outcome.get("verification_uri", "") %} {% set code = outcome.get("user_code", "") %} {% set acct_name = outcome.get("account", "") %}
{% if uri and code %} Open {{ uri }} and enter code: {{ code }} {% else %} Waiting for device code… {% endif %}
{% elif outcome.get("ok") %}
Success {% if outcome.get("detail") %} — {{ outcome.detail }}{% endif %}
{% if outcome.get("rows") %}
{% for row in outcome.rows %} {% endfor %}
UID From Subject Date
{{ row.get("uid", "") }} {{ row.get("from", "") }} {{ row.get("subject", "") }} {{ row.get("date", "") }}
{% endif %} {% else %}
Error {% if outcome.get("detail") %} — {{ outcome.detail }}{% endif %}
{% if outcome.get("detail") and "\n" in outcome.get("detail", "") %}
{{ outcome.detail }}
{% endif %} {% endif %}