{% extends "base.html" %} {% block title %}Final Delivery{% endblock %} {% block page_id %}final-delivery{% endblock %} {% block page_title %}Final Delivery{% endblock %} {% block eyebrow %}Delivery{% endblock %} {% block head %} {% endblock %} {% block content %}

Delivery

Final Delivery

Idle
📧 Email Ready
{{ matched_email }}
matched users with email
💬 WhatsApp Ready
{{ matched_wa }}
matched users with mobile
✅ Previous Runs
{{ prev_runs }}
completed delivery jobs
Send Emails
Gallery links to all {{ matched_email }} matched users
{% if email_tpl.has_template %}
✅ Template ready — "{{ email_tpl.subject[:45] }}..."
{% else %}
⚠️ No email template set — will use default
{% endif %}
Send WhatsApp
Gallery links to all {{ matched_wa }} matched users
{% if wa_tpl.has_template %}
✅ Template ready — {{ wa_tpl.template_name }}
{% else %}
⚠️ No WA template set — will use default ({{ 'event_gallery_link' }})
{% endif %}
Last Delivery Job
{% if last_job %}
{{ last_job.status | upper }} {% if last_job.started_at %}Started: {{ last_job.started_at[:19] }}{% endif %} {% if last_job.completed_at %}Finished: {{ last_job.completed_at[:19] }}{% endif %}
{% if last_job.result %}{% set r = last_job.result %} {% if r.type == 'email' %}

📧 Sent: {{ r.emails_sent or 0 }} · Failed: {{ r.emails_failed or 0 }} · Template: {{ r.template_used or 'Default' }}

{% elif r.type == 'whatsapp' %}

💬 Sent: {{ r.wa_sent or 0 }} · Failed: {{ r.wa_failed or 0 }} · No phone: {{ r.wa_no_phone or 0 }} · Template: {{ r.template_used or 'event_gallery_link' }}

{% elif r.type == 'browse_all_email' %}

📧 Browse-All Email — Sent: {{ r.emails_sent or 0 }} · Failed: {{ r.emails_failed or 0 }} · Skipped: {{ r.emails_skipped or 0 }}

{% elif r.type == 'browse_all_whatsapp' %}

💬 Browse-All WhatsApp — Sent: {{ r.wa_sent or 0 }} · Failed: {{ r.wa_failed or 0 }} · No phone: {{ r.wa_no_phone or 0 }}

{% endif %} {% endif %} {% else %}

No delivery jobs run yet.

{% endif %}
These visitors registered a face but our AI never matched them to any uploaded photo. Sending them the gallery link lets them browse every event photo themselves. WhatsApp reuses your existing approved template (Meta doesn't allow custom wording without separate approval) — email can have fully distinct wording, editable on the Email Templates page under "Browse All Photos - Email".
🔍 Not Matched
{{ unmatched_count }}
visitors with a registered face but 0 photo matches
Send "Browse All Photos" Email
Distinct message to all {{ unmatched_count }} not-matched visitors
{% if browse_email_tpl.has_template %}
✅ Template ready — "{{ browse_email_tpl.subject[:45] }}"
{% else %}
⚠️ Template inactive — will use built-in default
{% endif %}
Send "Browse All Photos" WhatsApp
Same approved template, sent only to not-matched visitors
ℹ️ Uses your active WhatsApp template (same as matched-visitor send)
{% if unmatched_visitors %} {% for v in unmatched_visitors %} {% endfor %}
VisitorEmailPhoneRegistered
{% if v.s3_image_url %}{% endif %} {{ v.name or '—' }} {{ v.email or '—' }} {{ v.phone or '—' }} {{ v.created_at.strftime('%d %b %Y, %H:%M') if v.created_at else '—' }}
{% else %}
🎉 Everyone with a registered face has been matched to at least one photo.
{% endif %}
⚠️

No Template Configured

Delivery Summary

# Name Email / Mobile Status
{% endblock %} {% block scripts %} {% endblock %}