mustachio icon indicating copy to clipboard operation
mustachio copied to clipboard

{{.}} not working for lists, take 2

Open tobinibot opened this issue 7 years ago • 1 comments

I know that the author of #5 says it’s working when you send an actual email, but I have been unable to get it to work, either in the preview renderer or in a delivered email.

I’m using the template

{{#list}}
  {{.}}
{{/list}}

and the JSON

{
  "list": [
    "xxx",
    "yyy",
    "zzz"
  ]
}

I’m just getting an empty body, in the preview and the delivered email. What gives, am I doing something wrong? This works out on the mustache demo page: https://mustache.github.io/#demo.

tobinibot avatar May 26 '17 17:05 tobinibot

The syntax is not the same as mustache. Use it as follows (note the difference being the each statement):

{{#each list}}
  {{.}}
{{/each}}

celluj34 avatar Aug 17 '17 22:08 celluj34