{% extends 'htmx_confirmation_modal.html.twig' %} {% set sendable = valid and attachmentError is null and recipients.eligibleCount > 0 %} {% block title %}Mail wirklich senden?{% endblock %} {% block content %} {% if not valid %}
Betreff und Nachricht müssen ausgefüllt sein, bevor die Mail gesendet werden kann.
{% elseif attachmentError is not null %}
{{ attachmentError }}
{% elseif recipients.eligibleCount == 0 %}
Auf den ausgewählten Einsätzen ist niemand bestätigt eingeteilt, dem geschrieben werden kann.
{% else %}
Die Mail geht an {{ recipients.eligibleCount }} Teamer:innen auf {{ mailingDto.assignments|length }} {{ mailingDto.assignments|length == 1 ? 'Einsatz' : 'Einsätzen' }}. Das lässt sich nicht zurücknehmen.
{{ mailingDto.subject }}
{{ mailingDto.message | u.truncate(400, '…', false) | nl2br }}
{% set attachmentNames = (mailingDto.template ? mailingDto.template.attachments|map(a => a.displayName ?? a.originalFilename) : [])|merge(pending|map(u => u.originalFilename)) %} {% if attachmentNames is not empty %}
Anhänge ({{ attachmentSize|file_size(1) }}): {{ attachmentNames|join(', ') }}
{% endif %} {% if recipients.hasSkipped %}
{{ include('admin/teamer/_mailing_skipped.html.twig', { 'recipients': recipients }) }}
{% endif %} {% endif %} {% endblock %} {# without a sendable mail there is nothing to confirm, the button only leads back to the draft #} {% block button_confirm %}{{ sendable ? 'Jetzt senden' : 'Zurück zum Entwurf' }}{% endblock %} {% block button_attribute %}{% if sendable %}hx-post="{{ path('app_administrative_assignment_mailing_send') }}" hx-include="#mailing-confirm-fields"{% else %}{{ stimulus_action('modal', 'close') }}{% endif %}{% endblock %}