verify eal
This commit is contained in:
@@ -1,37 +1,64 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import dotenv from "dotenv"
|
import dotenv from "dotenv"
|
||||||
import Bvn from "../model/bvnModel.js";
|
import Bvn from "../model/bvnModel.js";
|
||||||
|
import nodemailer from "nodemailer";
|
||||||
|
|
||||||
|
//import nodemailer from "modemailer"
|
||||||
|
//const nodemailer = require("modemailer");
|
||||||
export const verifyEmployer = async (req, res)=>{
|
export const verifyEmployer = async (req, res)=>{
|
||||||
const nodemailer = require("modemailer");
|
//const nodemailer = require("modemailer");
|
||||||
|
|
||||||
|
const mainHtml = " Dear Elvis,\n" +
|
||||||
|
"<br><br>\n" +
|
||||||
|
"\n" +
|
||||||
|
"We hope this email meets you well. " +
|
||||||
|
"This serves as an employer’s commitment to notify you that your staff (Olanrewaju Badmus) who holds the position of software engineer in your organization took a loan facility from our bank and has prompted us to notify you so as to confirm his existence as a staff of your organization." +
|
||||||
|
" Please click on the link below to confirm this before we can approve his loan\n " +
|
||||||
|
"<br><br>\n" +
|
||||||
|
"***Employer commitment link (You are to login with this email address and default password 2345090)\n " +
|
||||||
|
"<br><br>\n" +
|
||||||
|
"If you have any questions or concerns with respect to this email, please contact our finance department at finance@fcmb.webmail.\n \n Kind Regards,<br><br>\n" +
|
||||||
|
"Finance team, <br> FCMB<br>\n";
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("verifyEmployer REQ-----------------------------------------");
|
console.log("verifyEmployer REQ-----------------------------------------");
|
||||||
console.log(req.body);
|
console.log(req.body);
|
||||||
console.log("verifyEmployer REQ=========================================");
|
console.log("verifyEmployer REQ=========================================");
|
||||||
const transporter = nodemailer.createTransport({
|
const transporter2 = nodemailer.createTransport({
|
||||||
host: "smtp.ethereal.email",
|
host: "smtp.ethereal.email",
|
||||||
port: 587,
|
port: 587,
|
||||||
secure: false, // Use `true` for port 465, `false` for all other ports
|
secure: false, // Use `true` for port 465, `false` for all other ports
|
||||||
auth: {
|
auth: {
|
||||||
user: 'remington.kub@ethereal.email',
|
user: 'madilyn.medhurst@ethereal.email',
|
||||||
pass: 'ZWW4ZGFbStpv1gzyNa'
|
pass: 'wU3zwcKr538s9a8ybm'
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const transporter = nodemailer.createTransport({
|
||||||
|
service: "gmail",
|
||||||
|
host: "smtp.gmail.com",
|
||||||
|
port: 587,
|
||||||
|
secure: false,
|
||||||
|
auth: {
|
||||||
|
user: "message@chiefsoft.com",
|
||||||
|
pass: "may12002!",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// async..await is not allowed in global scope, must use a wrapper
|
// async..await is not allowed in global scope, must use a wrapper
|
||||||
async function main() {
|
async function main() {
|
||||||
// send mail with defined transport object
|
// send mail with defined transport object
|
||||||
const info = await transporter.sendMail({
|
const info = await transporter.sendMail({
|
||||||
from: '"Maddison Foo Koch 👻" <remington.kub@ethereal.email>', // sender address
|
from: '"Support Chiefsoft 👻" <message@chiefsoft.com>', // sender address
|
||||||
to: "ameye@chiefsoft.com, baz@example.com", // list of receivers
|
to: "ameye@chiefsoft.com, victor.ebuka@chiefsoft.com", // list of receivers
|
||||||
subject: "Hello ✔", // Subject line
|
subject: "Verify Loan Application ✔", // Subject line
|
||||||
text: "Hello world?", // plain text body
|
text: "Hello world?", // plain text body
|
||||||
html: "<b>Hello world?</b>", // html body
|
html: mainHtml, // html body
|
||||||
});
|
});
|
||||||
console.log("Message sent: %s", info.messageId);
|
console.log("Message sent: %s", info.messageId);
|
||||||
// Message sent: <d786aa62-4e0a-070a-47ed-0b0666549519@ethereal.email>
|
// Message sent: <d786aa62-4e0a-070a-47ed-0b0666549519@ethereal.email>
|
||||||
}
|
}
|
||||||
|
main().catch(console.error);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(error){
|
catch(error){
|
||||||
|
|||||||
Reference in New Issue
Block a user