import nodemailer from "nodemailer" // Lazy-initialized SMTP transport (Mailcow) let transporter: nodemailer.Transporter | null = null function getTransporter() { if (!transporter && process.env.SMTP_PASS) { transporter = nodemailer.createTransport({ host: process.env.SMTP_HOST || "mail.rmail.online", port: parseInt(process.env.SMTP_PORT || "587"), secure: false, auth: { user: process.env.SMTP_USER || "newsletter@cryptocommonsgather.ing", pass: process.env.SMTP_PASS, }, tls: { rejectUnauthorized: false }, }) } return transporter } const EMAIL_FROM = process.env.EMAIL_FROM || "Crypto Commons Gathering " interface PaymentConfirmationData { name: string email: string amountPaid: string paymentMethod: string contributions: string dietary: string } export async function sendPaymentConfirmation( data: PaymentConfirmationData ): Promise { const transport = getTransporter() if (!transport) { console.log("[Email] SMTP not configured, skipping confirmation email") return false } const html = `

You're In!

Crypto Commons Gathering 2026

Dear ${data.name},

Your payment of ${data.amountPaid} has been confirmed. You are now registered for Crypto Commons Gathering 2026 in Austria's Höllental Valley, August 16–22, 2026.

Registration Details

${data.dietary ? `` : ""}
Amount: ${data.amountPaid}
Payment: ${data.paymentMethod}
Dietary:${data.dietary}
${data.contributions ? `
What you're bringing:

${data.contributions}

` : ""}

What's Next?

  • Join the CCG26 Telegram group to connect with other participants
  • Start preparing your session proposals
  • Watch for pre-event communications with logistics details

See you in the valley,
The Crypto Commons Gathering Team


You received this email because you registered at cryptocommonsgather.ing.
cryptocommonsgather.ing

` try { const info = await transport.sendMail({ from: EMAIL_FROM, to: data.email, subject: "Registration Confirmed - Crypto Commons Gathering 2026", html, }) console.log( `[Email] Payment confirmation sent to ${data.email} (${info.messageId})` ) return true } catch (error) { console.error("[Email] Failed to send payment confirmation:", error) return false } }