fix email

This commit is contained in:
CHIEFSOFT\ameye
2024-08-28 08:17:56 -04:00
parent 63a416327f
commit ff37a3a3ef
+23 -17
View File
@@ -45,22 +45,26 @@ WRENCHJOB_EMAIL_PASS='may12002!'
// }, // },
// }); // });
const emailSubject = "A similar task is available"; const emailSubject = "A similar task is available";
console.log("HERE -- 00001***********************************************"); // console.log("HERE -- 00001***********************************************");
const mailMessage = await this.parseEmailFile('depend_job_added'); // const mailMessage = await this.parseEmailFile('depend_job_added');
//
console.log("HERE -- 00001aaa => mailMessage ==>",mailMessage,"==============0000=================="); // console.log("HERE -- 00001aaa => mailMessage ==>",mailMessage,"==============0000==================");
//
//
await this.parseEmailFile('depend_job_added').then((mailMessage)=>{ // await this.parseEmailFile('depend_job_added').then((mailMessage)=>{
console.log("HERE -- 00002***********************************************", mailMessage); // console.log("HERE -- 00002***********************************************", mailMessage);
const tempVal = this.getTemplateValues(mailMessage); // const tempVal = this.getTemplateValues(mailMessage);
console.log("MATCHED VALUES =>", tempVal); // console.log("MATCHED VALUES =>", tempVal);
console.log("HERE -- 00003***********************************************"); // console.log("HERE -- 00003***********************************************");
//
}); // });
fs.readFile(`${__dirname}/${file_name}`, 'utf8', (err, data) => {
if (err) {
console.error(err);
}
else
{
console.log(data);
const transporter = nodemailer.createTransport({ const transporter = nodemailer.createTransport({
service: "gmail", service: "gmail",
host: `${emailServer}`, host: `${emailServer}`,
@@ -74,6 +78,7 @@ WRENCHJOB_EMAIL_PASS='may12002!'
// //
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({
@@ -88,8 +93,9 @@ WRENCHJOB_EMAIL_PASS='may12002!'
// Message sent: <d786aa62-4e0a-070a-47ed-0b0666549519@ethereal.email> // Message sent: <d786aa62-4e0a-070a-47ed-0b0666549519@ethereal.email>
} }
main().catch(console.error); main().catch(console.error);
}
});
// });
console.log(" processLinedJobs ************************ : ", value); console.log(" processLinedJobs ************************ : ", value);
if (value.depend_uid !== undefined && value.depend_uid.length > 10){ if (value.depend_uid !== undefined && value.depend_uid.length > 10){