47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
export default defineEventHandler(async (event) => {
|
|
try {
|
|
// TODO: Implement proper notification templates table
|
|
// For now, returning mock data since notification tables don't exist in current schema
|
|
|
|
const mockTemplates = [
|
|
{
|
|
label: "Welcome Email",
|
|
value: "welcome_email",
|
|
subject: "Welcome to our platform!",
|
|
content: "<h1>Welcome {{first_name}}!</h1><p>Thank you for joining us.</p>",
|
|
pushTitle: "Welcome!",
|
|
pushBody: "Welcome to our platform, {{first_name}}!",
|
|
variables: ["first_name", "last_name"]
|
|
},
|
|
{
|
|
label: "Password Reset",
|
|
value: "password_reset",
|
|
subject: "Reset your password",
|
|
content: "<h1>Password Reset</h1><p>Click the link to reset your password.</p>",
|
|
pushTitle: "Password Reset",
|
|
pushBody: "Tap to reset your password",
|
|
variables: ["reset_link"]
|
|
},
|
|
{
|
|
label: "Order Confirmation",
|
|
value: "order_confirmation",
|
|
subject: "Order Confirmation #{{order_id}}",
|
|
content: "<h1>Order Confirmed!</h1><p>Your order #{{order_id}} has been confirmed.</p>",
|
|
pushTitle: "Order Confirmed!",
|
|
pushBody: "Your order #{{order_id}} is confirmed",
|
|
variables: ["order_id", "order_total"]
|
|
}
|
|
];
|
|
|
|
return {
|
|
success: true,
|
|
data: mockTemplates
|
|
}
|
|
} catch (error) {
|
|
console.error('Error fetching templates:', error)
|
|
throw createError({
|
|
statusCode: 500,
|
|
statusMessage: 'Failed to fetch templates'
|
|
})
|
|
}
|
|
})
|