Skip to content

Instantly share code, notes, and snippets.

@tjerman
Created February 17, 2022 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjerman/3b4f7bd593814cf4cceba1f170f6001c to your computer and use it in GitHub Desktop.
Save tjerman/3b4f7bd593814cf4cceba1f170f6001c to your computer and use it in GitHub Desktop.
Email template
{
"variables": {
"param1": "value1",
"param2": {
"nestedParam1": "value2"
},
"things": [
"thing 1",
"thing 2",
"thing 3",
"thing 4",
"thing 5",
"thing 6"
]
},
"options": {
"documentSize": "A4",
"contentScale": "1",
"orientation": "portrait",
"margin": "0.3"
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Title</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<h1>Hello, world!</h1>
<table>
<tr>
<th>#</th><th>thing</th>
</tr>
{{range $index, $element := .things}}
<tr>
<td>{{ $index }}</td>
<td>{{ $element }}</td>
</tr>
{{end}}
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment