mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-06 01:06:28 +08:00
Format admin notifications with unified subject prefix
This commit is contained in:
@@ -44,14 +44,18 @@ export default defineEventHandler(async (event) => {
|
||||
consentPrivacy: true,
|
||||
})
|
||||
|
||||
const lines = [
|
||||
`Titel: ${title}`,
|
||||
`Beschreibung: ${details}`,
|
||||
`Kontakt: ${email || '—'}`,
|
||||
allowContact ? 'Kontaktaufnahme erwünscht' : 'Keine Kontaktaufnahme erwünscht',
|
||||
const dataEntries = [
|
||||
['Titel', title],
|
||||
['Beschreibung', details],
|
||||
['E-Mail', email || null],
|
||||
['Kontaktaufnahme erlaubt', allowContact],
|
||||
]
|
||||
|
||||
await sendAdminNotification('[OpenSquawk] Neuer Roadmap-Vorschlag', lines.join('\n'))
|
||||
await sendAdminNotification({
|
||||
event: 'Neuer Roadmap-Vorschlag',
|
||||
summary: `Neuer Roadmap-Vorschlag: ${title}`,
|
||||
data: dataEntries,
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -56,16 +56,23 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
|
||||
if (!previouslyWantedUpdates && updateResult.created) {
|
||||
const lines = [
|
||||
`E-Mail: ${email}`,
|
||||
name ? `Name: ${name}` : null,
|
||||
notes ? `Notizen: ${notes}` : null,
|
||||
`Quelle: ${source}`,
|
||||
].filter(Boolean)
|
||||
await sendAdminNotification(
|
||||
'[OpenSquawk] Neue Updates-Liste (via Warteliste)',
|
||||
`${lines.join('\n')}\nOpt-In: Produkt-Updates`,
|
||||
)
|
||||
const dataEntries = [
|
||||
['E-Mail', email],
|
||||
]
|
||||
if (name) {
|
||||
dataEntries.push(['Name', name])
|
||||
}
|
||||
if (notes) {
|
||||
dataEntries.push(['Notizen', notes])
|
||||
}
|
||||
dataEntries.push(['Quelle', source])
|
||||
dataEntries.push(['Opt-In', 'Produkt-Updates'])
|
||||
|
||||
await sendAdminNotification({
|
||||
event: 'Neue Updates-Liste (via Warteliste)',
|
||||
summary: `Produkt-Updates Opt-in (Warteliste): ${email}`,
|
||||
data: dataEntries,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,14 +105,23 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
}
|
||||
|
||||
const lines = [
|
||||
`E-Mail: ${email}`,
|
||||
name ? `Name: ${name}` : null,
|
||||
notes ? `Notizen: ${notes}` : null,
|
||||
`Quelle: ${source}`,
|
||||
wantsProductUpdates ? 'Opt-In: Produkt-Updates' : 'Opt-In: nur Warteliste',
|
||||
].filter(Boolean)
|
||||
await sendAdminNotification('[OpenSquawk] Neue Wartelisten-Anmeldung', lines.join('\n'))
|
||||
const dataEntries = [
|
||||
['E-Mail', email],
|
||||
]
|
||||
if (name) {
|
||||
dataEntries.push(['Name', name])
|
||||
}
|
||||
if (notes) {
|
||||
dataEntries.push(['Notizen', notes])
|
||||
}
|
||||
dataEntries.push(['Quelle', source])
|
||||
dataEntries.push(['Opt-In', wantsProductUpdates ? 'Produkt-Updates' : 'Nur Warteliste'])
|
||||
|
||||
await sendAdminNotification({
|
||||
event: 'Neue Wartelisten-Anmeldung',
|
||||
summary: `Neue Wartelisten-Anmeldung: ${email}`,
|
||||
data: dataEntries,
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user