Node.js 如何使用angular和firestore将阵列发送到电子邮件
我正在尝试使用sendgrid从firestore数据库发送阵列数据 我尝试过使用文档,但没有成功Node.js 如何使用angular和firestore将阵列发送到电子邮件,node.js,google-cloud-firestore,google-cloud-functions,sendgrid,Node.js,Google Cloud Firestore,Google Cloud Functions,Sendgrid,我正在尝试使用sendgrid从firestore数据库发送阵列数据 我尝试过使用文档,但没有成功 export const newOrder = functions.firestore .document("checkout/{checkoutId}/products/{productId}") .onCreate(async (change, context) => { // Read booking document const pos
export const newOrder = functions.firestore
.document("checkout/{checkoutId}/products/{productId}")
.onCreate(async (change, context) => {
// Read booking document
const postSnap = await db
.collection("checkout/{checkoutId}/products")
.doc(context.params.productId)
.get();
const booking = postSnap.data() || {};
//Email
const msg = {
to: "wilmutsami@gmail.com",
from: "test@example.com",
templateId: TEMPLATE_ID,
dynamic_template_data: {
subject: "Hey there, thank you for your order!",
name: [booking.name],
amount: [booking.amount]
}
};
//Send it
return sgMail.send(msg);
});
{{{#each products}{{name}}:{{{price}{{{/each}}//这是我验证的html代码,似乎无法发送数据数组,但我将进一步调查您的示例似乎不完整。您要发送什么数组?“{{{#each products}}”我在您的示例中没有看到任何products属性我认为没有使用动态模板发送数组:as