File size: 956 Bytes
db00c33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
 * 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();