/** * Test OTP Email Sending via Brevo API * Run: node scripts/test-email.js */ require('dotenv').config(); const { sendOtpEmail } = require('../services/email.service'); async function testEmail() { const testEmail = 'imkkrish05@gmail.com'; const testOtp = '847291'; console.log('='.repeat(50)); console.log('๐Ÿงช Testing OTP Email via Brevo API'); console.log('='.repeat(50)); console.log(`๐Ÿ“ง Sending to: ${testEmail}`); console.log(`๐Ÿ” OTP: ${testOtp}`); console.log('='.repeat(50)); try { const result = await sendOtpEmail(testEmail, testOtp); console.log(''); console.log('โœ… Email sent successfully!'); console.log(`๐Ÿ“จ Message ID: ${result.messageId}`); console.log(''); console.log('๐Ÿ‘‰ Check your inbox at imkkrish05@gmail.com'); } catch (error) { console.error(''); console.error('โŒ Email sending failed!'); console.error(`Error: ${error.message}`); } } testEmail();