Antwort-Mails: hinterlegte Anlagen mitschicken (Standard: keine)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user