feat(mailing): Beispieltext als Vorlage im Rundmail-Formular

mailing_template() liefert Betreff und Text der Jahresend-Mail; das Formular ist
damit vorbefüllt und der Hinweis verlinkt auf 'Beispieltext wieder einsetzen'.
This commit is contained in:
torsten 2026-11-30 08:19:22 +01:00
parent 5cce6ca86f
commit 9f8365b9e7
3 changed files with 32 additions and 2 deletions

View file

@ -597,7 +597,8 @@ function admin_reminders_send(): void
*/
function admin_mailings(array $user): void
{
$values = ['subject' => '', 'body' => ''];
$template = mailing_template();
$values = ['subject' => $template['subject'], 'body' => $template['body'], 'from_template' => true];
$errors = [];
if (is_post()) {
@ -607,6 +608,7 @@ function admin_mailings(array $user): void
if ($action === 'test' || $action === 'create') {
$values['subject'] = trim(post_string('subject'));
$values['body'] = trim(post_string('body'));
$values['from_template'] = false;
if (mb_strlen($values['subject']) < 3 || mb_strlen($values['subject']) > 190) {
$errors['subject'] = 'Bitte einen Betreff mit 3 bis 190 Zeichen angeben.';
}