node.js - 如何使用 Angular 和 Firestore 将数组发送到电子邮件
问题描述
我正在尝试使用 sendgrid 从 firestore 数据库发送数组数据。
我试过使用文档没有运气。
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);
});
解决方案
推荐阅读
- angular - 在 Angular 项目中,我使用了显示密码。当我单击提交时,在检查验证后该图标会下降
- selenium-grid - 范围报告没有给出关于并行执行的正确报告
- android - 当我集成 Paytm 支付网关时,我得到一个“糟糕”屏幕
- python - 或正则表达式中文字字符串的条件
- json - JQ:设置顶层路径
- memory-leaks - 内存泄漏:肯定丢失,也可能丢失
- ios - 无法将“String”类型的值转换为预期的参数类型“UITextRange”
- ember.js - Ember 将值添加到 Django Rest API 中的外键字段
- python - 在python中添加分隔符
- powerbi - 在 PowerBI 中将整数转换为字符串并连接