mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-09 19:16:02 +08:00
Add reply-to support for admin notifications
This commit is contained in:
@@ -62,6 +62,7 @@ export default defineEventHandler(async (event) => {
|
||||
const highlightSelections = normaliseArray(body.highlightSelections)
|
||||
const frictionSelections = normaliseArray(body.frictionSelections)
|
||||
const allowContact = Boolean(body.contactConsent)
|
||||
const fromAddress = email ? (name ? `${name} <${email}>` : email) : undefined
|
||||
|
||||
const details: string[] = []
|
||||
details.push(`Overall excitement: ${excitement}/5`)
|
||||
@@ -107,7 +108,7 @@ export default defineEventHandler(async (event) => {
|
||||
['Discord', discordHandle || '—'],
|
||||
['Okay to contact', allowContact ? 'Yes' : 'No'],
|
||||
],
|
||||
from: email || undefined,
|
||||
replyTo: fromAddress,
|
||||
})
|
||||
|
||||
return { success: true }
|
||||
|
||||
@@ -30,6 +30,7 @@ export default defineEventHandler(async (event) => {
|
||||
const description = sanitize(body.description)
|
||||
const categories = sanitizeCategories(body.categories)
|
||||
const contactEmail = sanitize(body.contactEmail)
|
||||
const fromAddress = contactEmail || undefined
|
||||
|
||||
if (title.length < 4) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Title must be at least 4 characters long.' })
|
||||
@@ -60,7 +61,7 @@ export default defineEventHandler(async (event) => {
|
||||
['Categories', categories.join(', ')],
|
||||
['Contact email', contactEmail || '—'],
|
||||
],
|
||||
from: contactEmail || undefined,
|
||||
replyTo: fromAddress,
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -15,6 +15,7 @@ export default defineEventHandler(async (event) => {
|
||||
const email = body.email?.trim().toLowerCase()
|
||||
const name = body.name?.trim()
|
||||
const source = body.source?.trim() || 'landing-updates'
|
||||
const fromAddress = email ? (name ? `${name} <${email}>` : email) : undefined
|
||||
|
||||
if (!email) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Email is required' })
|
||||
@@ -46,6 +47,7 @@ export default defineEventHandler(async (event) => {
|
||||
event: 'New updates signup',
|
||||
summary: `New updates signup: ${email}`,
|
||||
data: dataEntries,
|
||||
replyTo: fromAddress,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ export default defineEventHandler(async (event) => {
|
||||
const notes = body.notes?.trim()
|
||||
const source = body.source?.trim() || 'landing'
|
||||
const wantsProductUpdates = Boolean(body.wantsProductUpdates)
|
||||
const fromAddress = email ? (name ? `${name} <${email}>` : email) : undefined
|
||||
|
||||
if (!email) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Email is required' })
|
||||
@@ -72,6 +73,7 @@ export default defineEventHandler(async (event) => {
|
||||
event: 'New updates signup (waitlist)',
|
||||
summary: `Product updates opt-in (waitlist): ${email}`,
|
||||
data: dataEntries,
|
||||
replyTo: fromAddress,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -121,6 +123,7 @@ export default defineEventHandler(async (event) => {
|
||||
event: 'New waitlist signup',
|
||||
summary: `New waitlist signup: ${email}`,
|
||||
data: dataEntries,
|
||||
replyTo: fromAddress,
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user