Closed sathyashiva9 closed 2 weeks ago
@sathyashiva9 were you able to resolve this?
@sathyashiva9 were you able to resolve this?
Yes it worked for me, we need to return a promise in the send email function.
export const sendEmail = async (emailContent: EmailContent, sendTo: string[]) => {
return new Promise((resolve, reject) => {
const mailOptions = {
from: 'javascriptmastery@outlook.com',
to: sendTo,
html: emailContent.body,
subject: emailContent.subject,
};
transporter.sendMail(mailOptions, (error: any, info: any) => {
if (error) {
console.log(error);
reject(error);
} else {
console.log('Email sent: ', info);
resolve(info);
}
});
});
}
It's sending welcome message when added a new product to track but it is not sending any price drop messages when the price goes below the lowest price. I have even tried by taking lowest price more than the current price. But still it is not sending mails.