{% extends 'administrative/layout.html.twig' %} {% block title %}Mailing{% endblock %} {% block content %}

Mailing an das Team

Zurück zur Teamübersicht
{{ include('admin/teamer/_mailing_filter_summary.html.twig', { 'filterDto': filterDto }) }}
{{ recipients.eligibleCount }} Empfänger:innen
{% if recipients.hasSkipped %}
{{ include('admin/teamer/_mailing_skipped.html.twig', { 'recipients': recipients }) }}
{% endif %}
{# One request per keystroke parks the draft - so that a trip to the filter and back keeps it - and answers with the preview, which is why the response is swapped into the pane instead of being thrown away. hx-trigger replaces htmx' default submit trigger, the "Vorschau an mich senden" button still posts natively. Deliberately without htmx' "changed" modifier: it compares the listening element's .value between events, and a
has none, so every event compares undefined to undefined and the request is never sent. The 500ms delay is what keeps the typing from flooding the route. #} {{ form_start(form, { 'attr': { 'id': 'mailing-form', 'hx-post': path('app_admin_teamer_mailing_draft'), 'hx-trigger': 'input delay:500ms', 'hx-target': '#mailing-preview', 'hx-swap': 'innerHTML', 'hx-indicator': '#mailing-preview-indicator', } }) }}
{{ form_row(form.subject) }} {{ form_row(form.message) }}
{{ include('_partials/_markdown_hint.html.twig') }}
Platzhalter für Betreff und Nachricht, sie werden beim Senden pro Person ersetzt:
{% for placeholder, label in placeholders %} {{ placeholder }} {{ label }} {% endfor %}
Vorschau
{{ include('admin/teamer/_mailing_preview.html.twig', preview) }}
{# Deliberately a sibling of the swap target, not a child: hx-swap replaces the target's contents, which would carry the indicator away with them. #}
{{ include('_partials/_spinner.html.twig', { 'class': 'w-8 h-8' }) }}
{# nobody to write to means there is nothing to confirm, only the preview stays useful #} {% if recipients.eligibleCount > 0 %} {% endif %} {% if hasDraft %} Entwurf verwerfen {% endif %}
{{ form_rest(form) }} {{ form_end(form) }} {% endblock %}