// Email templates for the contact form. // Brand-forward but email-client-safe: black header/footer bands (logo + gold, // the site's identity) wrapping a LIGHT body with dark text. Dark text on a // light body is the one combination Gmail dark mode never inverts, so it stays // readable everywhere — unlike a fully dark email, whose light text Gmail flips // to dark and hides. // Table layout + inline styles + bgcolor attributes for client compatibility. import { SITE_URL } from "@/lib/site"; const COLORS = { band: "#0a0a0a", // black brand bands (header/footer) — the site's black page: "#e9e4d8", // warm parchment page background card: "#fbfaf6", // near-white body card border: "#ddd6c6", // warm hairline border rule: "#c4b896", // gold accent rule ink: "#1a1714", // near-black body text inkSoft: "#5a5346", // secondary text accent: "#8a7338", // gold, darkened so it reads on the light body accentOnDark: "#c4b896", // site gold, used on the black bands box: "#f1ece0", // quoted-message background }; const DISPLAY_FONT = '"Arial Narrow", "Helvetica Neue Condensed", "Helvetica Neue", Arial, sans-serif'; const SANS_FONT = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif'; const STUDIO_NAME = "Highland Games Studio"; const TAGLINE = "Where summits become worlds."; // Loaded from the live site — the asset must be deployed there to render. const LOGO_EMAIL_URL = `${SITE_URL}/image/Studio/Full%20Logo.png`; function escapeHtml(value: string): string { return value .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } function nl2br(value: string): string { return escapeHtml(value).replace(/\n/g, "
"); } type ContactInput = { name: string; email: string; subject: string; message: string; }; // Small gold, wide-tracked eyebrow label — the site's signature accent. function eyebrow(text: string): string { return `
${text}
`; } // Big condensed uppercase heading, in near-black ink. function heading(text: string): string { return `
${text}
`; } function shell(innerHtml: string): string { return `
${innerHtml}
${STUDIO_NAME}
 
${STUDIO_NAME}
${TAGLINE}
Sent automatically from the studio website.
`; } // Sent to the studio staff with the submitted message. export function staffNotificationEmail(input: ContactInput): { subject: string; html: string; text: string; } { const { name, email, subject, message } = input; const row = (label: string, value: string) => `
${label}
${value}
`; const inner = ` ${eyebrow("New message")} ${heading("Someone reached out")} ${row("From", `${escapeHtml(name)} <${escapeHtml(email)}>`)} ${row("Subject", escapeHtml(subject))}
Message
${nl2br(message)}
Reply to ${escapeHtml(name)} →
`; return { subject: `[Contact] ${subject}`, html: shell(inner), text: `New message for ${STUDIO_NAME}\n\nFrom: ${name} <${email}>\nSubject: ${subject}\n\n${message}`, }; } // Auto-reply sent to the person who submitted the form. export function autoReplyEmail(input: ContactInput): { subject: string; html: string; text: string; } { const { name, message } = input; const firstName = name.split(/\s+/)[0] || name; const inner = ` ${eyebrow("Message received")} ${heading("Thanks for
reaching out")}

Hi ${escapeHtml(firstName)},

Thanks for getting in touch with ${STUDIO_NAME}. We've received your message and a real human will get back to you soon.

For reference, here's what you sent us:

${nl2br(message)}
The ${STUDIO_NAME} team
`; return { subject: `We got your message`, html: shell(inner), text: `Hi ${firstName},\n\nThanks for getting in touch with ${STUDIO_NAME}. We've received your message and a real human will get back to you soon.\n\nFor reference, here's what you sent us:\n\n${message}\n\nThe ${STUDIO_NAME} team`, }; }