feat: add mailing templates and mail the confirmed teamers of selected assignments

This commit is contained in:
fromme committed 2026-11-11 14:02:55 +01:00
1 parent 6c89f1b8a9
commit e285646bb2
57 files changed
+3525 -31

No files matched your search

@@ -0,0 +1,59 @@
{% set formAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
{{ form_start(form, { 'attr': formAttr.toArray() }) }}
{{ form_errors(form) }}
<div class="flex flex-col space-y-4 pb-4">
{{ form_row(form.name) }}
{{ form_row(form.subject) }}
{{ form_row(form.message) }}
</div>
<div class="flex flex-col space-y-4 pb-8">
{{ include('_partials/_mailing_placeholders.html.twig', { 'placeholders': placeholders }) }}
{{ include('_partials/_markdown_hint.html.twig') }}
</div>
<div class="pb-8">
<div class="font-bold">
Anhänge
</div>
<div class="pb-2 text-sm text-gray-500">
Sie gehen mit jeder Mail aus dieser Vorlage mit. Nur PDF, bis 5 MB je Datei und
{{ maxAttachmentBytes|file_size(0) }} zusammen.
</div>
{% if form.removeAttachments is defined %}
<ul class="flex flex-col space-y-1 pb-2">
{% for choice in form.removeAttachments %}
{% set attachment = template.attachments|filter(a => a.uuid == choice.vars.value)|first %}
<li class="flex items-center space-x-2 border rounded-sm px-2 py-1">
{{ icon('document', 'w-4 h-4 shrink-0') }}
<a href="{{ path('app_common_download', { 'uuid': attachment.uuid, 'inline': 1 }) }}"
target="_blank"
class="flex-1 underline">
{{ choice.vars.label }}
</a>
<span class="text-sm text-gray-500">{{ attachment.size|file_size(1) }}</span>
<label class="flex items-center space-x-1 text-sm">
{{ form_widget(choice) }}
<span>entfernen</span>
</label>
</li>
{% endfor %}
</ul>
{% endif %}
{{ include('_partials/_pending_uploads.html.twig', { 'uploads': pending }) }}
{% include '_partials/_upload_collection_form.html.twig' with {
'endpoint_upload': path('_uploader_upload_mailing_template'),
'max_filesize': 5,
'accepted_files': 'application/pdf',
} %}
</div>
<div class="flex items-center space-x-2">
<button type="submit" class="btn" {{ stimulus_target('form-upload-guard', 'submit') }}>
Speichern
</button>
<a href="{{ path('app_administrative_system_mailing_template_index') }}" class="btn btn--secondary">
Abbrechen
</a>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
@@ -0,0 +1,12 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Einstellungen - Mailvorlage anlegen{% endblock %}
{% block content %}
<div class="max-w-screen-md">
<h1 class="text-2xl font-bold pb-8">
Mailvorlage anlegen
</h1>
{% include 'administrative/system/mailing_template/_form.html.twig' %}
</div>
{% endblock %}
@@ -0,0 +1,12 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Einstellungen - Mailvorlage bearbeiten{% endblock %}
{% block content %}
<div class="max-w-screen-md">
<h1 class="text-2xl font-bold pb-8">
Mailvorlage bearbeiten
</h1>
{% include 'administrative/system/mailing_template/_form.html.twig' %}
</div>
{% endblock %}
@@ -0,0 +1,81 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Einstellungen - Mailvorlagen{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-2">
Mailvorlagen
</h1>
<div class="pb-8 text-gray-500">
Vorlagen für Mails an die Teamer:innen von Einsätzen. Die Einsätze wählst du in der
Einsatzübersicht aus.
</div>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th class="w-1/4">
Name
</th>
<th class="w-2/5">
Betreff
</th>
<th>
Anhänge
</th>
<th>
Geändert
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for template in templates %}
<tr>
<td>
<a href="{{ path('app_administrative_system_mailing_template_edit', { 'uuid': template.uuid }) }}">
{{ template.name }}
</a>
</td>
<td>
{{ template.subject }}
</td>
<td>
{{ template.attachments|length }}
</td>
<td class="whitespace-nowrap">
{{ (template.updatedAt ?? template.createdAt)|date('d.m.Y') }}
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
<button type="button"
class="text-red-500"
title="Mailvorlage löschen"
hx-get="{{ path('app_administrative_system_mailing_template_delete', { 'uuid': template.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
</button>
<a href="{{ path('app_administrative_system_mailing_template_edit', { 'uuid': template.uuid }) }}"
title="Mailvorlage bearbeiten">
{{ icon('edit') }}
</a>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<a href="{{ path('app_administrative_system_mailing_template_create') }}" class="btn">
Neu
</a>
{% endblock %}
@@ -0,0 +1,8 @@
{% extends 'htmx_confirmation_modal.html.twig' %}
{% block content %}
<div>
Möchtest du die Mailvorlage <em>{{ template.name }}</em> wirklich löschen? Bereits
gesendete Mails bleiben davon unberührt.
</div>
{% endblock %}