Spaces:
Paused
Paused
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();
|