{% extends 'admin/base.html.twig' %} {% block title %}Prospection{% endblock %} {% block breadcrumb %}Super administration Prospection{% endblock %} {# Prospection : importer → rédiger (IA) → relire → envoyer → suivre. Variables : tabs, tab, tabCounts, prospects, funnel, quota, sendSettings (ProspectingSettings), canGenerate, plans (formules payantes), links (ProspectLinks), generating #} {% macro pct(part, whole) %}{{ whole > 0 ? ((part / whole * 100)|round ~ ' %') : '—' }}{% endmacro %} {% import _self as m %} {% set statusLabels = { new: ['Nouveau', 'neutral'], queued: ['En file', 'info'], generating: ['Rédaction…', 'info'], to_review: ['À relire', 'action'], sent: ['Envoyé', 'info'], visited: ['A ouvert', 'good'], claimed: ['Récupéré', 'good'], rejected: ['Écarté', 'neutral'], declined: ['Pas intéressé', 'neutral'], unsubscribed: ['Désinscrit', 'neutral'], failed: ['Échec', 'bad'], expired: ['Expiré', 'neutral'] } %} {% block body %}

Prospection

Préparez le site d'un commerce, envoyez-le-lui : il le récupère en un clic, avec un mois offert.

{{ quota.sentToday }} / {{ quota.limit }} e-mails aujourd'hui

{# Réglages d'envoi (ouverts quand les envois sont suspendus) #}
Réglages d'envoi {{ quota.limit == 0 ? 'envois suspendus' : quota.limit ~ ' e-mails par jour au plus' }} · {{ sendSettings.senderIdentity }}
Premiers envois et relances. Protège la réputation d'envoi ; 0 = envois suspendus.
Raison sociale et adresse, en pied de chaque e-mail : un message de prospection doit dire qui l'envoie.
{% if sendSettings.updatedAt %}

Modifié le {{ sendSettings.updatedAt|date('d/m/Y à H:i') }}{% if sendSettings.updatedBy %} par {{ sendSettings.updatedBy }}{% endif %}.

{% endif %}
{# Entonnoir #}
{{ funnel.total }}prospects
{{ funnel.sent }}sites envoyés
{{ funnel.visited }}ont ouvert · {{ m.pct(funnel.visited, funnel.sent) }}
{{ funnel.claimed }}récupérés · {{ m.pct(funnel.claimed, funnel.sent) }}
{{ funnel.subscribed }}abonnés · {{ m.pct(funnel.subscribed, funnel.claimed) }}
{% if not canGenerate %}
Aucun moteur IA n'est configuré : les sites ne peuvent pas être rédigés. Configurer le moteur IA
{% endif %} {# Entrée des prospects #}

Importer un fichier

Colonnes reconnues : nom (obligatoire), activite, ville, email, telephone, site, histoire — séparateur ; ou ,. Doublons et adresses désinscrites sont écartés d'office.

Ajouter un prospect

{# Onglets #} {% if tab == 'todo' %} {% set waiting = prospects|filter(p => p.status in ['new', 'failed'])|length %}
{% if waiting > 0 %}
{% endif %} {% if generating > 0 %}

{{ generating }} site{{ generating > 1 ? 's' }} en rédaction — la page se met à jour toute seule.

{% endif %}
{% endif %} {% if prospects is empty %}
{% if tab == 'review' %}Aucun site à relire pour l'instant. {% elseif tab == 'todo' %}Importez un fichier ou ajoutez un prospect pour commencer. {% else %}Rien ici pour l'instant.{% endif %}
{% elseif tab == 'review' %}
{% for p in prospects %}

{{ p.businessName }}

{{ [p.activity, p.city]|filter(v => v)|join(' · ') }}{% if p.phone %} · {{ p.phone }}{% endif %}

Mois offert : {{ p.planCode|capitalize }}
{% if p.website %}

A déjà un site : {{ p.website }} — le message le prend en compte.

{% endif %}
·
{% endfor %}
{% else %}
{% for p in prospects %} {% set label = statusLabels[p.status]|default([p.status, 'neutral']) %} {% endfor %}
Commerce Contact Statut {{ tab == 'won' ? 'Récupéré le' : (tab in ['sent', 'closed'] ? 'Envoyé le' : 'Ajouté le') }} Actions
{{ p.businessName }}
{{ [p.activity, p.city]|filter(v => v)|join(' · ') }}
{{ p.email ?: '—' }}{% if p.phone %}
{{ p.phone }}{% endif %}
{{ label[0] }} {% if p.status in ['sent', 'visited'] %}
{{ p.visits }} visite{{ p.visits > 1 ? 's' }} · {{ p.followUps }} relance{{ p.followUps > 1 ? 's' }}
{% elseif p.status == 'claimed' and p.site and p.site.subscription %}
{% if p.site.subscription.paidByStripe %} Abonné {{ p.site.subscription.plan.name }} {% elseif p.site.subscription.status == 'trial' %}Essai jusqu'au {{ p.site.subscription.trialEndDate|date('d/m') }} {% else %}{{ p.site.subscription.plan.name }}{% endif %}
{% endif %} {% if p.error %}
{{ p.error }}
{% endif %}
{% if tab == 'won' %}{{ p.claimedAt ? p.claimedAt|date('d/m/Y') }} {% elseif tab in ['sent', 'closed'] %}{{ p.sentAt ? p.sentAt|date('d/m/Y') : '—' }} {% else %}{{ p.createdAt|date('d/m/Y') }}{% endif %} {% if p.site and p.status not in ['rejected', 'declined', 'unsubscribed', 'expired'] and p.status != 'generating' %} Site {% endif %} {% if p.status == 'failed' %}
{% endif %}
{% endif %}
{% if generating > 0 %} {% endif %} {% endblock %}