// import emailjs, { EmailJSResponseStatus } from '@emailjs/nodejs';

const { default: axios } = require("axios");

// const {emailjs, EmailJSResponseStatus } = require("@emailjs/nodejs");

// const  {emailjs, EmailJSResponseStatus } =  require('emailjs/nodejs');
// https://api.emailjs.com/api/v1.0/email/send
const sendOtp = async (data) => {
    try {
        url = 'https://api.emailjs.com/api/v1.0/email/send'
        const emailResp  = axios.post(url,data);
        console.log('SUCCESS!',emailResp);
      } catch (err) {      
        console.log('ERROR', err);
      }
}


// var data = {
//     service_id: 'service_4h3ddef',
//     template_id: 'template_6ywfrsr',
//     user_id: 'pCLFvPFTBusiCuBfQ',
//     accessToken: 'uHWsvxOzTCp-9JLhvYN0O',
//     template_params: {
//         'otp' : '1235',
//         'to_email': 'saimzain1236@gmail.com',
//         'to_name': 'Zain',
//         'from_name': 'DejaVu Plus'        
//     }
// };

// sendOtp(data)

module.exports = sendOtp;