Fixed batch sending snapshots dates

no issue

The snapshots contained the current date, so they broke every day. This commit fixes the issue by setting a fixed date.
This commit is contained in:
Simon Backx 2023-03-15 09:45:36 +01:00
parent 7c9e77bc81
commit b27c7bc707
2 changed files with 11 additions and 9 deletions

View File

@ -292,7 +292,7 @@ table.body figcaption a {
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" width=\\"100%\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\">
<tr>
<td class=\\"post-meta\\" style=\\"font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; vertical-align: top; padding-bottom: 50px; color: #738a94; font-size: 13px; letter-spacing: 0.2px; text-transform: uppercase; text-align: center;\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">14 Mar 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
</td>
</tr>
</table>
@ -416,7 +416,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 14 Mar 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 1 Jan 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
@ -1196,7 +1196,7 @@ table.body figcaption a {
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" width=\\"100%\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\">
<tr>
<td class=\\"post-meta\\" style=\\"font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; vertical-align: top; padding-bottom: 50px; color: #738a94; font-size: 13px; letter-spacing: 0.2px; text-transform: uppercase; text-align: center;\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">14 Mar 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
</td>
</tr>
</table>
@ -1312,7 +1312,7 @@ This is a test post title [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 14 Mar 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 1 Jan 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
@ -1659,7 +1659,7 @@ table.body figcaption a {
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" width=\\"100%\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\">
<tr>
<td class=\\"post-meta\\" style=\\"font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; vertical-align: top; padding-bottom: 50px; color: #738a94; font-size: 13px; letter-spacing: 0.2px; text-transform: uppercase; text-align: center;\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">14 Mar 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
</td>
</tr>
</table>
@ -1775,7 +1775,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 14 Mar 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 1 Jan 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
@ -2124,7 +2124,7 @@ table.body figcaption a {
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" width=\\"100%\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\">
<tr>
<td class=\\"post-meta\\" style=\\"font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; vertical-align: top; padding-bottom: 50px; color: #738a94; font-size: 13px; letter-spacing: 0.2px; text-transform: uppercase; text-align: center;\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">14 Mar 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
By Joe Bloggs &#x2013; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 &#x2013; </span><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">View online &#x2192;</a>
</td>
</tr>
</table>
@ -2240,7 +2240,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 14 Mar 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs 1 Jan 2023 View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]

View File

@ -64,7 +64,9 @@ async function createPublishedPostEmail(settings = {}, email_recipient_filter) {
const updatedPost = {
status: 'published',
updated_at: res.body.posts[0].updated_at
updated_at: res.body.posts[0].updated_at,
// Fixed publish date to make sure snapshots are consistent
published_at: moment(new Date(2023, 0, 1, 12)).toISOString()
};
const newsletterSlug = fixtureManager.get('newsletters', 0).slug;