Spaces:
Paused
Paused
Download scripts/test-email.js from imkrish/yatra-x-user: direct link, hf CLI and curl.
- Browser
- Download file 956 Bytes
-
https://huggingface.co/spaces/imkrish/yatra-x-user/resolve/main/scripts/test-email.js
- Command line
-
hf download hf://spaces/imkrish/yatra-x-user/scripts/test-email.js
-
curl -L -o test-email.js https://huggingface.co/spaces/imkrish/yatra-x-user/resolve/main/scripts/test-email.js
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(); | |