First you have more than just a comma issue in your template. Missing quotes and object brackets. I have assumed content is an array due to these errors in template layout.
Second when posting flows it is best to use the </> icon and post between triple backticks as this adds a simple copy button , for ease of copying.
Here are two examples of how to do this.
Hope they help.
[{"id":"881abd96032c5eeb","type":"inject","z":"d1395164b4eec73e","name":"example payoad","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"firstName\":\"one\",\"lastName\":\"one\",\"email\":\"one@mail.com\"},{\"firstName\":\"two\",\"lastName\":\"two\",\"email\":\"two@mail.com\"},{\"firstName\":\"three\",\"lastName\":\"three\",\"email\":\"three@mail.com\"},{\"firstName\":\"four\",\"lastName\":\"four\",\"email\":\"four@mail.com\"}]","payloadType":"json","x":140,"y":720,"wires":[["cabf2ce109fd87c5","57b46d5e3607a2d2"]]},{"id":"cabf2ce109fd87c5","type":"template","z":"d1395164b4eec73e","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"content\": [\n {\"rows\":\n [\n \"delete this\"\n {{#payload}}\n ,{\n \"fields\": [\n \"{{firstName}}\",\n \"{{lastName}}\",\n \"{{email}}\"\n ]\n }\n {{/payload}} \n ]\n },\n {\n \"type\": \"toc\",\n \"title\": \"Table of contents\",\n \"levels\": 2\n }\n ]\n}","output":"json","x":320,"y":720,"wires":[["cefc7e45bef07918"]]},{"id":"57b46d5e3607a2d2","type":"function","z":"d1395164b4eec73e","name":"function 22","func":"const output = {\n \"content\": [\n {\n \"rows\":\n []\n },\n {\n \"type\": \"toc\",\n \"title\": \"Table of contents\",\n \"levels\": 2\n }\n ]\n};\nmsg.payload.forEach(obj => {\n output.content[0].rows.push(\n {\n \"fields\":[\n obj.firstName,\n obj.lastName,\n obj.email\n ]\n }\n )\n})\nmsg.payload = output;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":820,"wires":[["5635ef7dfd8c9052"]]},{"id":"cefc7e45bef07918","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"payload.content[0].rows[0]","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":720,"wires":[["0201468987664a63"]]},{"id":"5635ef7dfd8c9052","type":"debug","z":"d1395164b4eec73e","name":"debug 345","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":820,"wires":[]},{"id":"0201468987664a63","type":"debug","z":"d1395164b4eec73e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":720,"wires":[]}]