fix email

This commit is contained in:
CHIEFSOFT\ameye
2024-08-28 08:17:56 -04:00
parent 63a416327f
commit ff37a3a3ef
+47 -41
View File
@@ -45,51 +45,57 @@ WRENCHJOB_EMAIL_PASS='may12002!'
// },
// });
const emailSubject = "A similar task is available";
console.log("HERE -- 00001***********************************************");
const mailMessage = await this.parseEmailFile('depend_job_added');
console.log("HERE -- 00001aaa => mailMessage ==>",mailMessage,"==============0000==================");
await this.parseEmailFile('depend_job_added').then((mailMessage)=>{
console.log("HERE -- 00002***********************************************", mailMessage);
const tempVal = this.getTemplateValues(mailMessage);
console.log("MATCHED VALUES =>", tempVal);
console.log("HERE -- 00003***********************************************");
});
const transporter = nodemailer.createTransport({
service: "gmail",
host: `${emailServer}`,
port: 587,
secure: false,
auth: {
user: "message@chiefsoft.com",
pass: `${emailServerPass}`,
},
});
// console.log("HERE -- 00001***********************************************");
// const mailMessage = await this.parseEmailFile('depend_job_added');
//
// console.log("HERE -- 00001aaa => mailMessage ==>",mailMessage,"==============0000==================");
//
//
// await this.parseEmailFile('depend_job_added').then((mailMessage)=>{
// console.log("HERE -- 00002***********************************************", mailMessage);
// const tempVal = this.getTemplateValues(mailMessage);
// console.log("MATCHED VALUES =>", tempVal);
// 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({
service: "gmail",
host: `${emailServer}`,
port: 587,
secure: false,
auth: {
user: "message@chiefsoft.com",
pass: `${emailServerPass}`,
},
});
//
async function main() {
// send mail with defined transport object
const info = await transporter.sendMail({
from: '"Support ChiefSoft 👻" <message@chiefsoft.com>', // sender address
to: "ameye@chiefsoft.com", // list of receivers
bcc: "ses66181@gmail.com", // list of receivers
subject: `${emailSubject}`, // Subject line
text: "To Tester name", // plain text body
html: mailMessage, // html body
});
console.log("Message sent: %s", info.messageId);
// Message sent: <d786aa62-4e0a-070a-47ed-0b0666549519@ethereal.email>
}
main().catch(console.error);
// });
async function main() {
// send mail with defined transport object
const info = await transporter.sendMail({
from: '"Support ChiefSoft 👻" <message@chiefsoft.com>', // sender address
to: "ameye@chiefsoft.com", // list of receivers
bcc: "ses66181@gmail.com", // list of receivers
subject: `${emailSubject}`, // Subject line
text: "To Tester name", // plain text body
html: mailMessage, // html body
});
console.log("Message sent: %s", info.messageId);
// Message sent: <d786aa62-4e0a-070a-47ed-0b0666549519@ethereal.email>
}
main().catch(console.error);
}
});
console.log(" processLinedJobs ************************ : ", value);
if (value.depend_uid !== undefined && value.depend_uid.length > 10){