Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ docker run -d -p 9000:9000 -v email-template-data:/app/data email-template-edito

Data lives in `/app/data/db.json`. Mount a volume there so it survives container re-creation. The image is seeded with the repository's `db.json`.

### Sample data

The repository's `db.json` holds a complete example: a No More To-Go "Weekly Menu" issue.

- **Tree:** the root HTML has three slots (`{{items}}`, `{{items2}}`, `{{items3}}`). Each slot holds a two-column row with two recipe cards, six recipes in total. Each card's `{{link}}`, `{{image}}`, `{{title}}` and `{{subtitle}}` are filled.
- **Elements:** `{{twoBlocks}}` (two-column row), `{{recipeCard}}` (photo, title and subtitle) and `{{textBlock}}` (a paragraph).

Every child's title appears in its parent's HTML, and keys are unique. `POST /generate` renders the issue with no placeholders left over.

Development with hot reload:

```bash
Expand Down
293 changes: 185 additions & 108 deletions db.json

Large diffs are not rendered by default.

226 changes: 223 additions & 3 deletions public/generated/nmtgTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,203 @@
<td id="imageBlock-14" align="center">
<a href="https://www.nomoretogo.com/weekly-menu/" data-link-id="960357277" target="_self">

<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe1.jpeg" border="0" alt="" width="267" style="display: block;">
<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe5.jpeg" border="0" alt="" width="267" style="display: block;">

</a>
</td>
</tr>
<tr>
<td align="center" style="padding: 0px 20px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
<tr>
<td align="left" class="bodyTitle" id="bodyText-14" style="font-family: &#39;Poppins&#39;, sans-serif; font-size: 14px; line-height: 150%; color: #6f6f6f;">
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Chipotle Cream Salmon</span></strong><br>with Roasted Potatoes and Broccolini</p>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<!--[if mso]>
</td>
<td valign="top">
<![endif]-->
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="left" width="267" class="mlContentTable marginBottom" style="width: 267px; min-width: 267px;">
<tbody><tr>
<td id="imageBlock-14" align="center">
<a href="https://www.nomoretogo.com/weekly-menu/" data-link-id="960357277" target="_self">

<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe4.jpeg" border="0" alt="" width="267" style="display: block;">

</a>
</td>
</tr>
<tr>
<td align="center" style="padding: 0px 20px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
<tr>
<td align="left" class="bodyTitle" id="bodyText-14" style="font-family: &#39;Poppins&#39;, sans-serif; font-size: 14px; line-height: 150%; color: #6f6f6f;">
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Korean Barbecue Beef</span></strong><br>with Rice Noodles and Crunchy Veggies</p>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td align="center" style="padding: 0px 40px;" class="mlContentOuter"></td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<table align="center" border="0" bgcolor="#ffffff" class="mlContentTable mlContentTableDefault" cellpadding="0" cellspacing="0" width="640">
<tbody><tr>
<td class="mlContentTableCardTd">
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" class="mlContentTable ml-default" style="width: 640px; min-width: 640px;" width="640">
<tbody><tr>
<td>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td height="20" class="spacingHeight-20" style="line-height: 20px; min-height: 20px;"></td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td align="center" style="padding: 0px 40px;" class="mlContentOuter">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" border="0" align="center" width="100%">
<tbody><tr>
<td valign="top">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="left" width="267" class="mlContentTable marginBottom" style="width: 267px; min-width: 267px;">
<tbody><tr>
<td id="imageBlock-14" align="center">
<a href="https://www.nomoretogo.com/weekly-menu/" data-link-id="960357277" target="_self">

<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe6.jpeg" border="0" alt="" width="267" style="display: block;">

</a>
</td>
</tr>
<tr>
<td align="center" style="padding: 0px 20px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
<tr>
<td align="left" class="bodyTitle" id="bodyText-14" style="font-family: &#39;Poppins&#39;, sans-serif; font-size: 14px; line-height: 150%; color: #6f6f6f;">
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Saucy Shrimp Salad</span></strong><br>with Sweet Corn and Radishes</p>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<!--[if mso]>
</td>
<td valign="top">
<![endif]-->
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="left" width="267" class="mlContentTable marginBottom" style="width: 267px; min-width: 267px;">
<tbody><tr>
<td id="imageBlock-14" align="center">
<a href="https://www.nomoretogo.com/weekly-menu/" data-link-id="960357277" target="_self">

<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe2.jpeg" border="0" alt="" width="267" style="display: block;">

</a>
</td>
</tr>
<tr>
<td align="center" style="padding: 0px 20px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
<tr>
<td align="left" class="bodyTitle" id="bodyText-14" style="font-family: &#39;Poppins&#39;, sans-serif; font-size: 14px; line-height: 150%; color: #6f6f6f;">
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Pork Schnitzel</span></strong><br>with German Spaetzle and Green Beans</p>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td align="center" style="padding: 0px 40px;" class="mlContentOuter"></td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<table align="center" border="0" bgcolor="#ffffff" class="mlContentTable mlContentTableDefault" cellpadding="0" cellspacing="0" width="640">
<tbody><tr>
<td class="mlContentTableCardTd">
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" class="mlContentTable ml-default" style="width: 640px; min-width: 640px;" width="640">
<tbody><tr>
<td>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td height="20" class="spacingHeight-20" style="line-height: 20px; min-height: 20px;"></td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="640" style="width: 640px; min-width: 640px;" class="mlContentTable">
<tbody><tr>
<td align="center" style="padding: 0px 40px;" class="mlContentOuter">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
</tbody></table>
<table role="presentation" cellpadding="0" border="0" align="center" width="100%">
<tbody><tr>
<td valign="top">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="left" width="267" class="mlContentTable marginBottom" style="width: 267px; min-width: 267px;">
<tbody><tr>
<td id="imageBlock-14" align="center">
<a href="https://www.nomoretogo.com/weekly-menu/" data-link-id="960357277" target="_self">

<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe3.jpeg" border="0" alt="" width="267" style="display: block;">

</a>
</td>
Expand All @@ -2476,7 +2672,7 @@
</tr>
<tr>
<td align="left" class="bodyTitle" id="bodyText-14" style="font-family: &#39;Poppins&#39;, sans-serif; font-size: 14px; line-height: 150%; color: #6f6f6f;">
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Chipotle Cream Skillet Chicken</span></strong><br>over Rice and Snap Peas</p>
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Banh Mi Meatball Skewers</span></strong><br>with Sriracha Mayo</p>
</td>
</tr>
</tbody></table>
Expand All @@ -2487,7 +2683,31 @@
</td>
<td valign="top">
<![endif]-->
{{simpleTest}}
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="left" width="267" class="mlContentTable marginBottom" style="width: 267px; min-width: 267px;">
<tbody><tr>
<td id="imageBlock-14" align="center">
<a href="https://www.nomoretogo.com/weekly-menu/" data-link-id="960357277" target="_self">

<img src="https://raw.githubusercontent.com/LLazyEmail/nomoretogo_email_template/main/data/images/recipe1.jpeg" border="0" alt="" width="267" style="display: block;">

</a>
</td>
</tr>
<tr>
<td align="center" style="padding: 0px 20px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
<tbody><tr>
<td height="20" class="spacingHeight-20"></td>
</tr>
<tr>
<td align="left" class="bodyTitle" id="bodyText-14" style="font-family: &#39;Poppins&#39;, sans-serif; font-size: 14px; line-height: 150%; color: #6f6f6f;">
<p style="margin-top: 0px; margin-bottom: 0px; line-height: 150%; text-align: center;"><strong></strong><strong><span style="font-size: 16px;">Yogurt Spiced Chicken</span></strong><br>over Rice and Snap Peas</p>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
Expand Down
Loading