Push-Zeitmail: Vorlage T15, Zuordnung Pusher → Mitarbeiter, Versand

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-09-30 13:39:12 +00:00
1 parent ec3f22d98e
commit 1a1005d099
5 files changed
+306 -3

No files matched your search

+19
View File
@@ -129,3 +129,22 @@ export async function sendCustomerMail(to, { attachments = [], ...message }) {
attachments,
})
}
/**
* Mail an eine einzelne Person im Team aus einer T-Vorlage (z. B. T15 Push-Zeitmail), ohne BCC.
* Wirft bei fehlendem SMTP oder Versandfehler - der Aufrufer entscheidet, ob das schlimm ist.
* @param {string} to
* @param {{ template: string, values?: object, blocks?: object }} message
*/
export async function sendStaffMail(to, message) {
const mailer = getTransporter()
if (!mailer) throw new Error('SMTP nicht konfiguriert')
const mail = render(message)
return mailer.sendMail({
from: `"${TEAM_SENDER}" <${config.smtp.from}>`,
to,
subject: mail.subject,
text: mail.text,
html: mail.html,
})
}