我正在尝试在 SendWithUs 中使用jinja
. 我的数据包含一个双嵌套变量。
> { "bookingList": [
> {
> "attendees": [
> {
> "age": "8",
> "name": "Tommy"
> },
> {
> "age": "9",
> "name": "Mila"
> }
> ],
> "classStartTime": "2020-01-30T17:00:00.000Z",
> "classTitle": "Test class",
> "count": "2",
> "price": "10"
> },
> {
> "attendees": [
> {
> "age": "8",
> "name": "Tommy"
> },
> {
> "age": "9",
> "name": "Mila"
> }
> ],
> "classStartTime": "2020-01-30T17:00:00.000Z",
> "classTitle": "Test class 2",
> "count": "2",
> "price": "10"
> } ], "customerInfo": {
> "email": "test@test.com",
> "firstName": "test" }, "orderInfo": {
> "orderId": "64d02680-364d-11ea-981c-42010a2ad1c1",
> "subtotalPaid": "32.09",
> "taxPaid": "3.94",
> "totalPaid": "36.03" }, "subject": "Test 123" }
我正在尝试获取数据以显示
这些是您的注册详细信息:
{{bookingList.attendees.name}}
注册{{bookingList.classTitle}}
于{{bookingList.classStartTime}}
它正确地显示了classTitle
和classStartTime
,但是用这个词'name'
代替了实际的名字。
你如何处理双重嵌套变量?