fix offer letter
This commit is contained in:
+44
-17
@@ -1,22 +1,51 @@
|
||||
import nodemailer from "nodemailer";
|
||||
|
||||
export const offerLetter = async (req, res)=>{
|
||||
/*
|
||||
loan": {
|
||||
"id": "47",
|
||||
"uid": "18352568-df88-462c-bcc2-22f075a61b93",
|
||||
"customer_uid": "0d7f3c0a-0242-4b7e-9e45-26e28d436473",
|
||||
"loan_amount": "400000",
|
||||
"payment_month": "12",
|
||||
"sales_agent": "2442552",
|
||||
"gender": null,
|
||||
"marital_status": "single",
|
||||
"email": "oladeji@gmail.com",
|
||||
"address": "3235 SATELLITE BLVD STE 300",
|
||||
"state": "lagos",
|
||||
"country": "NG",
|
||||
"loan_detail": "{\"customer_uid\":\"0d7f3c0a-0242-4b7e-9e45-26e28d436473\",\"loan_amount\":\"400000\",\"payment_month\":\"12\",\"sales_agent\":\"2442552\",\"gender\":\"male\",\"address\":\"3235 SATELLITE BLVD STE 300\",\"marital_status\":\"single\",\"state\":\"lagos\",\"email\":\"oladeji@gmail.com\",\"country\":\"NG\",\"employer_uid\":\"b44a3f7e-ee55-4dbe-9f71-1329f287147e\",\"employment\":\"{\\\"job_title\\\":\\\"Engineer\\\",\\\"name\\\":\\\"\\\",\\\"sector\\\":\\\"\\\",\\\"industry\\\":\\\"\\\",\\\"resumption_date\\\":\\\"2024-12-26\\\",\\\"email\\\":\\\"\\\",\\\"annual_income\\\":\\\"2000000\\\",\\\"monthly_salary\\\":\\\"400000\\\",\\\"salary_payment_date\\\":\\\"2025-01-06\\\",\\\"employment_id\\\":\\\"12345678\\\",\\\"highest_eductaion\\\":\\\"b.sc + professional qualification\\\",\\\"isChecked\\\":false}\",\"loan_reference\":\"[{\\\"fullname\\\":\\\"BJ ola\\\",\\\"relationship\\\":\\\"Friend\\\",\\\"phone_number\\\":\\\"4042722172\\\",\\\"email\\\":\\\"bjnett@gmail.com\\\",\\\"bvn\\\":\\\"12345676543\\\"},{\\\"fullname\\\":\\\"ADe Bola\\\",\\\"relationship\\\":\\\"Sister\\\",\\\"phone_number\\\":\\\"4042722173\\\",\\\"email\\\":\\\"oladeji@gmail.com\\\",\\\"bvn\\\":\\\"53573663777\\\"}]\",\"disbursement_account\":\"0210501965\",\"disbursement\":\"{\\\"account\\\":\\\"0210501965\\\"}\"}",
|
||||
"status": "4",
|
||||
"added": "2025-01-12 22:07:33.735895",
|
||||
"updated": "2025-01-12 22:07:33.735895",
|
||||
"employer_uid": "b44a3f7e-ee55-4dbe-9f71-1329f287147e",
|
||||
"disbursement_account": "0210501965",
|
||||
"pc": "0"
|
||||
},
|
||||
*/
|
||||
|
||||
const employee_name = req.body.firstname + " " + req.body.lastname; // "EMPLOYEE NAME";
|
||||
const signatory_name = req.body.signatory_name;
|
||||
const approve_link = "https://digifi-employer.chiefsoft.net";
|
||||
const approve_password = req.body.signatory_password; //"1234567890";
|
||||
const application_uid = req.body.application_uid;
|
||||
const signatory_email = req.body.signatory_email;
|
||||
|
||||
const mainHtml = `
|
||||
Dear, Banji,
|
||||
try {
|
||||
console.log("verifyEmployer REQ-----------------------------------------");
|
||||
console.log(req.body);
|
||||
console.log("verifyEmployer REQ=========================================");
|
||||
|
||||
const employee_name = req.body.firstname; // "EMPLOYEE NAME";
|
||||
const signatory_name = req.body.signatory_name;
|
||||
const loan_amount = req.body.loan_amount;
|
||||
const payment_month = req.body.payment_month; //"1234567890";
|
||||
const application_uid = req.body.application_uid;
|
||||
const target_email = req.body.email;
|
||||
|
||||
const mainHtml = `
|
||||
Dear, ${employee_name},
|
||||
|
||||
We are happy to present your loan offer with the details below:
|
||||
|
||||
Loan Offer
|
||||
Loan Amount: N1,000,000
|
||||
Tenor: 12 months
|
||||
Loan Amount: N ${loan_amount}
|
||||
Tenor: ${payment_month} months
|
||||
Monthly Interest rate: 5%
|
||||
Management Fee (taken upfront): 1%
|
||||
Insurance fee (taken upfront): 1%
|
||||
@@ -25,18 +54,16 @@ export const offerLetter = async (req, res)=>{
|
||||
Total repayment: N1,353,904.92
|
||||
Accept Loan Offer
|
||||
|
||||
***Loan Offer Approval (You are to login with this to your portal to approve the loan )
|
||||
***Loan Offer Approval (You are to login with this to your portal to approve the loan)
|
||||
|
||||
If you have any questions or concerns about this email, please get in touch with our finance department at processingbank@email.com. Kind Regards,
|
||||
If you have any questions or concerns about this email, please get in touch with our finance department at processingbank@email.com.
|
||||
|
||||
Kind Regards,
|
||||
|
||||
Finance team,
|
||||
Processing Bank
|
||||
`;
|
||||
|
||||
try {
|
||||
console.log("verifyEmployer REQ-----------------------------------------");
|
||||
console.log(req.body);
|
||||
console.log("verifyEmployer REQ=========================================");
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
service: "gmail",
|
||||
@@ -53,7 +80,7 @@ export const offerLetter = async (req, res)=>{
|
||||
// send mail with defined transport object
|
||||
const info = await transporter.sendMail({
|
||||
from: '"Support ChiefSoft 👻" <message@chiefsoft.com>', // sender address
|
||||
to: signatory_email, // list of receivers
|
||||
to: target_email, // list of receivers
|
||||
bcc: "ameye@chiefsoft.com, victor.ebuka@chiefsoft.com", // list of receivers
|
||||
subject: "Bank Loan Offer ✔", // Subject line
|
||||
text: "Hello "+signatory_name+"?", // plain text body
|
||||
|
||||
Reference in New Issue
Block a user