/** * Send one branded verification e-mail through the configured transport (ops check). * RESEND_API_KEY=… EMAIL_FROM="RareIndex " pnpm exec tsx scripts/send-test-mail.mts you@example.com */ import { existsSync } from 'node:fs'; import path from 'node:path'; import { sendMail, verificationEmail } from '@rareindex/notify'; for (const f of [path.resolve(process.cwd(), '../../.env'), path.resolve(process.cwd(), '.env')]) { if (existsSync(f)) process.loadEnvFile(f); } const to = process.argv[2]; if (!to) { console.error('usage: send-test-mail.mts '); process.exit(1); } const m = verificationEmail({ code: String(Math.floor(100000 + Math.random() * 900000)), minutes: 10 }); const r = await sendMail({ to, ...m, subject: `[RareIndex test] ${m.subject}`, tags: [{ name: 'kind', value: 'verify-test' }] }); console.log(JSON.stringify(r)); process.exit(r.ok ? 0 : 1);