/** * Welcome Email — sent once when a user first connects their email address. */ import { getSmtpTransport } from "./notification-service"; export async function sendWelcomeEmail(email: string, username: string): Promise { const transport = await getSmtpTransport(); if (!transport) { console.warn("[welcome-email] No SMTP transport available"); return; } const displayName = username || "there"; const demoUrl = "https://demo.rspace.online"; const createUrl = "https://rspace.online/create"; const html = `

Welcome to rSpace, ${escapeHtml(displayName)}!

Reclaim (you)rSpace on the internet — one place for your group to coordinate around what you care about.

Instead of scattering your group across Slack, Google Docs, Trello, Zoom, Splitwise, and a dozen other apps — (you)rSpace puts it all in one shared workspace that your group actually owns.

Plan together. Decide together. Fund together. Build together. No corporate middlemen.

How groups use rSpace

Plan & Decide
Schedule, vote, set priorities — decisions flow into tasks automatically
Create & Share
Docs, maps, data — all synced, all encrypted, all yours
Fund & Sustain
Shared wallets, resource flows, transparent budgets
Stay Connected
Chat, meet, coordinate — without giving your conversations to ad companies

🔐 Your identity is yours. One passkey — no passwords, no seeds, no email loops. Works everywhere, owned by nobody but you.

Explore the Demo Space Create Your Space

You can manage your email in profile settings at any time.

`; try { await transport.sendMail({ from: "rSpace ", to: email, subject: `Welcome to rSpace, ${displayName} — your group's new home`, html, replyTo: "hello@rspace.online", }); console.log(`[welcome-email] Sent to ${email}`); } catch (err: any) { console.error(`[welcome-email] Failed to send to ${email}:`, err.message); } } function escapeHtml(s: string): string { return s.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); }