// Email templates for Spanglish platform // These are the default templates that get seeded into the database export interface EmailVariable { name: string; description: string; example: string; } export interface DefaultTemplate { name: string; slug: string; subject: string; subjectEs: string; bodyHtml: string; bodyHtmlEs: string; bodyText: string; bodyTextEs: string; description: string; variables: EmailVariable[]; isSystem: boolean; } // Common variables available in all templates export const commonVariables: EmailVariable[] = [ { name: 'siteName', description: 'Website name', example: 'Spanglish' }, { name: 'siteUrl', description: 'Website URL', example: 'https://spanglish.com' }, { name: 'currentYear', description: 'Current year', example: '2026' }, { name: 'supportEmail', description: 'Support email address', example: 'hello@spanglish.com' }, ]; // Booking-specific variables export const bookingVariables: EmailVariable[] = [ { name: 'attendeeName', description: 'Attendee full name', example: 'John Doe' }, { name: 'attendeeEmail', description: 'Attendee email', example: 'john@example.com' }, { name: 'ticketId', description: 'Unique ticket ID', example: 'TKT-ABC123' }, { name: 'qrCode', description: 'QR code for check-in', example: 'data:image/png;base64,...' }, { name: 'ticketPdfUrl', description: 'URL to download ticket PDF', example: 'https://api.spanglish.com/api/tickets/abc123/pdf' }, { name: 'eventTitle', description: 'Event title', example: 'Spanglish Night - January Edition' }, { name: 'eventDate', description: 'Event date formatted', example: 'January 28, 2026' }, { name: 'eventTime', description: 'Event time', example: '7:00 PM' }, { name: 'eventLocation', description: 'Event location', example: 'Casa Cultural, Asunción' }, { name: 'eventLocationUrl', description: 'Google Maps link', example: 'https://maps.google.com/...' }, { name: 'eventPrice', description: 'Event price with currency', example: '50,000 PYG' }, ]; // Payment-specific variables export const paymentVariables: EmailVariable[] = [ { name: 'paymentAmount', description: 'Payment amount with currency', example: '50,000 PYG' }, { name: 'paymentMethod', description: 'Payment method used', example: 'Lightning' }, { name: 'paymentReference', description: 'Payment reference ID', example: 'PAY-XYZ789' }, { name: 'paymentDate', description: 'Payment date', example: 'January 28, 2026' }, ]; // Payment instructions variables (for manual payment methods) export const paymentInstructionsVariables: EmailVariable[] = [ { name: 'tpagoLink', description: 'TPago payment link', example: 'https://tpago.com.py/...' }, { name: 'bankName', description: 'Bank name', example: 'Banco Itaú' }, { name: 'bankAccountHolder', description: 'Account holder name', example: 'Spanglish SRL' }, { name: 'bankAccountNumber', description: 'Bank account number', example: '1234567890' }, { name: 'bankAlias', description: 'Bank alias or phone', example: '0981-123-456' }, { name: 'bankPhone', description: 'Bank phone number', example: '0981-123-456' }, ]; // Base HTML wrapper for all emails export const baseEmailWrapper = `
Hi {{attendeeName}},
Great news! Your spot for {{eventTitle}} has been confirmed. We can't wait to see you there!
Your Ticket ID
{{qrCode}}
See you at Spanglish!
The Spanglish Team
`, bodyHtmlEs: `Hola {{attendeeName}},
¡Excelentes noticias! Tu lugar para {{eventTitle}} ha sido confirmado. ¡No podemos esperar a verte ahí!
Tu ID de Ticket
{{qrCode}}
¡Nos vemos en Spanglish!
El Equipo de Spanglish
`, bodyText: `Your Booking is Confirmed! Hi {{attendeeName}}, Great news! Your spot for {{eventTitle}} has been confirmed. Event Details: - Event: {{eventTitle}} - Date: {{eventDate}} - Time: {{eventTime}} - Location: {{eventLocation}} Your Ticket ID: {{ticketId}} Important: Please arrive 10-15 minutes early for check-in. Bring your ticket ID or show this email. See you at Spanglish! The Spanglish Team`, bodyTextEs: `¡Tu Reserva está Confirmada! Hola {{attendeeName}}, ¡Excelentes noticias! Tu lugar para {{eventTitle}} ha sido confirmado. Detalles del Evento: - Evento: {{eventTitle}} - Fecha: {{eventDate}} - Hora: {{eventTime}} - Ubicación: {{eventLocation}} Tu ID de Ticket: {{ticketId}} Importante: Por favor llega 10-15 minutos antes para el check-in. Trae tu ID de ticket o muestra este email. ¡Nos vemos en Spanglish! El Equipo de Spanglish`, description: 'Sent automatically when a booking is confirmed after payment', variables: [...commonVariables, ...bookingVariables], isSystem: true, }, { name: 'Payment Receipt', slug: 'payment-receipt', subject: 'Payment Receipt - Spanglish', subjectEs: 'Recibo de Pago - Spanglish', bodyHtml: `Hi {{attendeeName}},
Thank you for your payment! Here's your receipt for your records.
Keep this email as your payment confirmation.
The Spanglish Team
`, bodyHtmlEs: `Hola {{attendeeName}},
¡Gracias por tu pago! Aquí está tu recibo para tus registros.
Guarda este email como tu confirmación de pago.
El Equipo de Spanglish
`, bodyText: `Payment Received Hi {{attendeeName}}, Thank you for your payment! Here's your receipt: Payment Details: - Amount: {{paymentAmount}} - Method: {{paymentMethod}} - Reference: {{paymentReference}} - Date: {{paymentDate}} Event: {{eventTitle}} Date: {{eventDate}} Ticket ID: {{ticketId}} Keep this email as your payment confirmation. The Spanglish Team`, bodyTextEs: `Pago Recibido Hola {{attendeeName}}, ¡Gracias por tu pago! Aquí está tu recibo: Detalles del Pago: - Monto: {{paymentAmount}} - Método: {{paymentMethod}} - Referencia: {{paymentReference}} - Fecha: {{paymentDate}} Evento: {{eventTitle}} Fecha: {{eventDate}} ID de Ticket: {{ticketId}} Guarda este email como tu confirmación de pago. El Equipo de Spanglish`, description: 'Sent automatically after payment is processed', variables: [...commonVariables, ...bookingVariables, ...paymentVariables], isSystem: true, }, { name: 'Event Update', slug: 'event-update', subject: 'Important Update: {{eventTitle}}', subjectEs: 'Actualización Importante: {{eventTitle}}', bodyHtml: `Hi {{attendeeName}},
We have an important update regarding {{eventTitle}}.
{{customMessage}}
If you have any questions, please don't hesitate to contact us.
The Spanglish Team
`, bodyHtmlEs: `Hola {{attendeeName}},
Tenemos una actualización importante sobre {{eventTitle}}.
{{customMessage}}
Si tienes alguna pregunta, no dudes en contactarnos.
El Equipo de Spanglish
`, bodyText: `Important Event Update Hi {{attendeeName}}, We have an important update regarding {{eventTitle}}. Message: {{customMessage}} Event Details: - Event: {{eventTitle}} - Date: {{eventDate}} - Time: {{eventTime}} - Location: {{eventLocation}} If you have any questions, please don't hesitate to contact us. The Spanglish Team`, bodyTextEs: `Actualización Importante del Evento Hola {{attendeeName}}, Tenemos una actualización importante sobre {{eventTitle}}. Mensaje: {{customMessage}} Detalles del Evento: - Evento: {{eventTitle}} - Fecha: {{eventDate}} - Hora: {{eventTime}} - Ubicación: {{eventLocation}} Si tienes alguna pregunta, no dudes en contactarnos. El Equipo de Spanglish`, description: 'Template for sending event updates to attendees (sent manually)', variables: [ ...commonVariables, ...bookingVariables, { name: 'customMessage', description: 'Custom message from admin', example: 'The venue has changed...' } ], isSystem: true, }, { name: 'Post-Event Follow-Up', slug: 'post-event-followup', subject: 'Thanks for joining {{eventTitle}}! 🙏', subjectEs: '¡Gracias por asistir a {{eventTitle}}! 🙏', bodyHtml: `Hi {{attendeeName}},
Thank you so much for being part of {{eventTitle}}! We hope you had a great time practicing languages and meeting new people.
{{customMessage}}
Follow us on social media for updates and photos from the event!
See you at the next Spanglish!
The Spanglish Team
`, bodyHtmlEs: `Hola {{attendeeName}},
¡Muchas gracias por ser parte de {{eventTitle}}! Esperamos que hayas pasado un gran momento practicando idiomas y conociendo gente nueva.
{{customMessage}}
¡Síguenos en redes sociales para actualizaciones y fotos del evento!
¡Nos vemos en el próximo Spanglish!
El Equipo de Spanglish
`, bodyText: `Thank You for Joining Us! Hi {{attendeeName}}, Thank you so much for being part of {{eventTitle}}! We hope you had a great time. {{customMessage}} Follow us on social media for updates and photos from the event! See you at the next Spanglish! The Spanglish Team`, bodyTextEs: `¡Gracias por Unirte! Hola {{attendeeName}}, ¡Muchas gracias por ser parte de {{eventTitle}}! Esperamos que hayas pasado un gran momento. {{customMessage}} ¡Síguenos en redes sociales para actualizaciones y fotos del evento! ¡Nos vemos en el próximo Spanglish! El Equipo de Spanglish`, description: 'Template for post-event follow-up emails (sent manually)', variables: [ ...commonVariables, ...bookingVariables, { name: 'customMessage', description: 'Custom message from admin', example: 'We would love to hear your feedback!' }, { name: 'nextEventTitle', description: 'Next event title (optional)', example: 'Spanglish Night - February' }, { name: 'nextEventDate', description: 'Next event date (optional)', example: 'February 25, 2026' }, { name: 'nextEventUrl', description: 'Next event booking URL (optional)', example: 'https://spanglish.com/book/...' }, ], isSystem: true, }, { name: 'Custom Email', slug: 'custom-email', subject: '{{customSubject}}', subjectEs: '{{customSubject}}', bodyHtml: `Hi {{attendeeName}},
The Spanglish Team
`, bodyHtmlEs: `Hola {{attendeeName}},
El Equipo de Spanglish
`, bodyText: `{{customTitle}} Hi {{attendeeName}}, {{customMessage}} The Spanglish Team`, bodyTextEs: `{{customTitle}} Hola {{attendeeName}}, {{customMessage}} El Equipo de Spanglish`, description: 'Blank template for fully custom emails', variables: [ ...commonVariables, { name: 'attendeeName', description: 'Recipient name', example: 'John Doe' }, { name: 'customSubject', description: 'Email subject', example: 'Special Announcement' }, { name: 'customTitle', description: 'Email title/heading', example: 'Special Announcement' }, { name: 'customMessage', description: 'Email body content (supports HTML)', example: 'Your message here...
' }, ], isSystem: true, }, { name: 'Payment Instructions - TPago', slug: 'payment-instructions-tpago', subject: 'Complete your payment for Spanglish', subjectEs: 'Completa tu pago para Spanglish', bodyHtml: `Hi {{attendeeName}},
To complete your booking for:
Please complete your payment using TPago at the link below:
If the button doesn't work: {{tpagoLink}}
Or use this link: {{bookingUrl}}
If you have any questions, just reply to this email.
See you soon,
Spanglish
Hola {{attendeeName}},
Para completar tu reserva para:
Por favor completa tu pago usando TPago en el siguiente enlace:
Si el botón no funciona: {{tpagoLink}}
O usa este enlace: {{bookingUrl}}
Si tienes alguna pregunta, simplemente responde a este email.
¡Nos vemos pronto!
Spanglish
Hi {{attendeeName}},
Here are the bank transfer details for your booking:
Or use this link: {{bookingUrl}}
If you need help, reply to this email.
See you at the event,
Spanglish
Hola {{attendeeName}},
Aquí están los datos de transferencia para tu reserva:
O usa este enlace: {{bookingUrl}}
Si necesitas ayuda, responde a este email.
¡Nos vemos en el evento!
Spanglish
Hi {{attendeeName}},
We wanted to follow up on your booking for {{eventTitle}}.
We haven't been able to locate your payment yet. To receive your ticket and confirm your spot, please complete your payment.
We hope to see you at the event!
The Spanglish Team
`, bodyHtmlEs: `Hola {{attendeeName}},
Queríamos dar seguimiento a tu reserva para {{eventTitle}}.
Aún no hemos podido localizar tu pago. Para recibir tu entrada y confirmar tu lugar, por favor completa tu pago.
¡Esperamos verte en el evento!
El Equipo de Spanglish
`, bodyText: `Payment Reminder Hi {{attendeeName}}, We wanted to follow up on your booking for {{eventTitle}}. We haven't been able to locate your payment yet. To receive your ticket and confirm your spot, please complete your payment. Event Details: - Event: {{eventTitle}} - Date: {{eventDate}} - Time: {{eventTime}} - Location: {{eventLocation}} - Amount Due: {{paymentAmount}} Complete your payment here: {{bookingUrl}} Already paid? If you have already completed your payment and believe this is an error, please reply to this email with your payment details (date, amount, and method used) and we'll be happy to look into it. We hope to see you at the event! The Spanglish Team`, bodyTextEs: `Recordatorio de Pago Hola {{attendeeName}}, Queríamos dar seguimiento a tu reserva para {{eventTitle}}. Aún no hemos podido localizar tu pago. Para recibir tu entrada y confirmar tu lugar, por favor completa tu pago. Detalles del Evento: - Evento: {{eventTitle}} - Fecha: {{eventDate}} - Hora: {{eventTime}} - Ubicación: {{eventLocation}} - Monto a Pagar: {{paymentAmount}} Completa tu pago aquí: {{bookingUrl}} ¿Ya pagaste? Si ya completaste tu pago y crees que esto es un error, por favor responde a este correo con los detalles de tu pago (fecha, monto y método utilizado) y con gusto lo revisaremos. ¡Esperamos verte en el evento! El Equipo de Spanglish`, description: 'Sent to remind attendees to complete their pending payment', variables: [ ...commonVariables, ...bookingVariables, { name: 'paymentAmount', description: 'Payment amount with currency', example: '50,000 PYG' }, { name: 'bookingUrl', description: 'URL to complete payment', example: 'https://spanglish.com/booking/abc123?step=payment' }, ], isSystem: true, }, { name: 'Payment Rejected', slug: 'payment-rejected', subject: 'Payment not found for your Spanglish booking', subjectEs: 'No encontramos el pago de tu reserva en Spanglish', bodyHtml: `Hi {{attendeeName}},
Thanks for your interest in Spanglish.
Unfortunately, we were unable to find or confirm the payment for your booking for:
Because of this, the booking has been cancelled.
You're always welcome to make a new booking if spots are still available.
{{#if newBookingUrl}} {{/if}}Warm regards,
Spanglish
Hola {{attendeeName}},
Gracias por tu interés en Spanglish.
Lamentablemente, no pudimos encontrar o confirmar el pago de tu reserva para:
Por esta razón, la reserva ha sido cancelada.
Siempre eres bienvenido/a a hacer una nueva reserva si aún hay lugares disponibles.
{{#if newBookingUrl}} {{/if}}Saludos cordiales,
Spanglish