yatra-x-user / scripts /test-email.js
imkrish's picture
Upload folder using huggingface_hub
db00c33 verified
Raw History Blame Contribute Delete
956 Bytes
/**
* 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();