/** * Email templates for transactional emails * Uses inline CSS for maximum email client compatibility */ const baseStyles = ` body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; line-height: 1.6; color: #2d3142; background-color: #ffffff; margin: 0; padding: 0; } .container { max-width: 600px; margin: 0 auto; padding: 2rem 1rem; } .header { text-align: center; margin-bottom: 2rem; } .header h1 { color: #2d3142; font-size: 1.5rem; margin: 0; } .content { background: #ffffff; padding: 2rem; border-radius: 0.5rem; border: 1px solid #bfc0c0; } .button { display: inline-block; background-color: #ef8354; color: #ffffff; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 6px; font-weight: 500; font-size: 1rem; margin: 1rem 0; border: 2px solid #ef8354; } .footer { text-align: center; margin-top: 2rem; color: #4f5d75; font-size: 0.875rem; } .code { background: #f5f5f5; border: 1px solid #bfc0c0; border-radius: 0.25rem; padding: 0.5rem 1rem; font-family: 'Courier New', monospace; font-size: 1.5rem; letter-spacing: 0.25rem; text-align: center; margin: 1rem 0; } .info-box { background: #f5f5f5; border: 1px solid #bfc0c0; border-radius: 6px; padding: 1.25rem; margin: 1rem 0; } .info-box-label { color: #4f5d75; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05rem; margin: 0 0 0.25rem 0; font-weight: 600; } .info-box-value { color: #2d3142; font-size: 1rem; margin: 0; } .info-box-divider { border: 0; border-top: 1px solid #bfc0c0; margin: 1rem 0; } `; interface VerifyEmailOptions { name: string | null; code: string; token: string; } export function verifyEmailTemplate(options: VerifyEmailOptions): string { const greeting = options.name ? `Hi ${options.name}` : "Hi there"; const origin = process.env.ORIGIN || "http://localhost:3000"; const verifyLink = `${origin}/api/auth/verify-email?token=${options.token}`; return ` Verify Your Email - Thistle

🪻 Thistle

${greeting}!

Thanks for signing up for Thistle. Please verify your email address to get started.

Your verification code is:

${options.code}

This code will expire in 24 hours. Enter it in the verification dialog after you login, or click the button below:

Verify Email

`.trim(); } interface PasswordResetOptions { name: string | null; resetLink: string; } export function passwordResetTemplate(options: PasswordResetOptions): string { const greeting = options.name ? `Hi ${options.name}` : "Hi there"; return ` Reset Your Password - Thistle

🪻 Thistle

${greeting}!

We received a request to reset your password. Click the button below to create a new password.

Reset Password

If the button doesn't work, copy and paste this link into your browser:
${options.resetLink}

This link will expire in 1 hour.

`.trim(); } interface TranscriptionCompleteOptions { name: string | null; originalFilename: string; transcriptLink: string; className?: string; } export function transcriptionCompleteTemplate( options: TranscriptionCompleteOptions, ): string { const greeting = options.name ? `Hi ${options.name}` : "Hi there"; return ` Transcription Complete - Thistle

🪻 Thistle

${greeting}!

Your transcription is ready!

${ options.className ? `

Class

${options.className}


` : "" }

File

${options.originalFilename}

View Transcript

`.trim(); } interface EmailChangeOptions { name: string | null; currentEmail: string; newEmail: string; verifyLink: string; } export function emailChangeTemplate(options: EmailChangeOptions): string { const greeting = options.name ? `Hi ${options.name}` : "Hi there"; return ` Verify Email Change - Thistle

🪻 Thistle

${greeting}!

You requested to change your email address.

Current Email

${options.currentEmail}


New Email

${options.newEmail}

Click the button below to confirm this change:

Verify Email Change

If the button doesn't work, copy and paste this link into your browser:
${options.verifyLink}

This link will expire in 24 hours.

`.trim(); }