我正在使用 MailChimp Transactional API,但在填充使用 mc:repeatable 部分的电子邮件模板时遇到问题。我找不到有关如何执行此操作的任何文档或示例。这是使用https://mailchimp.com/developer/transactional/api/messages/send-using-message-template/的端点
这是我的电子邮件模板
<!DOCTYPE html>
<html lang="en">
<head>
<title>Your Order</title>
</head>
<body>
<div>Thanks for your order</div>
<div>Your receipt for your order from</div>
<div mc:edit="store_name">Store Name</div>
<div>Order Type</div>
<div mc:edit="order_type">Type</div>
<div>Products:</div>
<table>
<tr mc:repeatable="products">
<td mc:edit="quantity">Quantity</td>
<td mc:edit="product_name">Product Name</td>
<td mc:edit="price">Price</td>
</tr>
</table>
</body>
</html>
我可以在请求正文中mc:edit
使用它来填充所有区域:template_content
const content = [
{
name: 'store_name',
content: 'Any Store Name'
},
{
name: 'order_type',
content: 'Pickup Order'
},
{
name: 'subtotal',
content: '$80.00'
},
{
name: 'taxes',
content: '$2.22'
},
{
name: 'fees',
content: '$0.00'
},
{
name: 'total',
content: '$82.22'
}
]
quantity
如果我添加对象,我什至可以在可重复部分中填充单行product_name
,price
但我需要能够重复此部分并添加多个数量 > 产品名称 > 价格行。
任何建议或帮助或文档都会很棒,谢谢!