Format admin notifications with unified subject prefix

This commit is contained in:
Remi
2025-09-17 17:45:05 +02:00
committed by itsrubberduck
parent 8366845f15
commit 09481b6bfa
4 changed files with 179 additions and 33 deletions

View File

@@ -37,12 +37,16 @@ export default defineEventHandler(async (event) => {
})
if (result.created) {
const lines = [
`E-Mail: ${email}`,
name ? `Name: ${name}` : null,
`Quelle: ${source}`,
].filter(Boolean)
await sendAdminNotification('[OpenSquawk] Neue Updates-Liste', lines.join('\n'))
const dataEntries = [
['E-Mail', email],
['Name', name || null],
['Quelle', source],
]
await sendAdminNotification({
event: 'Neue Updates-Liste',
summary: `Neue Updates-Anmeldung: ${email}`,
data: dataEntries,
})
}
return {