Antwort-Mails: hinterlegte Anlagen mitschicken (Standard: keine)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 11:48:39 +02:00
co-authored by Claude Opus 4.8
parent c2c51f9fca
commit 7dddbe18b1
2 changed files with 28 additions and 0 deletions
+13
View File
@@ -1389,6 +1389,19 @@ initializeDatabase().then(() => {
attNames.push(a.dateiname);
}
// Selected static attachments (Zeugnisse etc.), e.g. from a reply form.
// Default: none selected.
let basisAnlageIds = req.body.basis_anlage || [];
if (!Array.isArray(basisAnlageIds)) basisAnlageIds = [basisAnlageIds];
for (const bid of basisAnlageIds) {
const ba = await dbGet('SELECT * FROM basis_anhaenge WHERE id = ?', [bid]);
if (!ba) continue;
const p = path.join(basisAnhaengeDir, ba.pfad);
if (!fs.existsSync(p)) continue;
attachments.push({ filename: ba.dateiname, path: p, contentType: ba.mime || undefined });
attNames.push(ba.dateiname);
}
// Threading headers when this is a reply to a stored message.
let inReplyTo = null, references = null;
if (req.body.reply_to) {