Mailjet Vars blank array throws error

这一生的挚爱 提交于 2019-12-13 00:06:09

问题


$array = [
  "low_price_low_stock_goods" => []
]

In my mailjet template

   {% for item in var:low_price_low_stock_goods %}
       <tr>
           <td>{{ item.good_name }}</td>
           <td>{{ item.value }}</td>
           <td>{{ item.count }}</td>
       </tr>
   {% endfor %}

error is now No value for "var:low_price_low_stock_goods"


回答1:


As I answered you on Github Ricky: it's a known issue on Mailjet's templating language side, sorry for that. To avoid it, just pass a valid object in the API call for the low_price_low_stock_goods value. This will work:

{
  item.good_name: "",
  item.value: "",
  item.count: ""
}


来源:https://stackoverflow.com/questions/43996715/mailjet-vars-blank-array-throws-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!