是否有一种方法可以在调用的html
部分中遍历一个对象?我有一些子对象,需要在电子邮件中显示它们的值。
const sgMail = require('@sendgrid/mail')
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
const sendReviewsCount = (reviewsCount, email) => {
const msg = {
to: email,
from: 'test@test.com',
subject: `Reviews Total`,
html: `${reviewsCount}`,
};
sgMail.send(msg);
}
module.exports = {
sendReviewsCount
}