Fixed including current email in last 3 posts in newsletters

refs https://github.com/TryGhost/Team/issues/2675

The current post could be inclnuded in the last 3 posts if it was also published. This is now fixed and covered by a test.
This commit is contained in:
Simon Backx 2023-03-24 09:18:51 +01:00
parent c06f161766
commit a9791e95cc
3 changed files with 776 additions and 30 deletions

View File

@ -400,7 +400,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<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: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -529,7 +529,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
@ -995,7 +995,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/email/post-uuid/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -1116,7 +1116,7 @@ This is a test post title [http://127.0.0.1:2369/email/post-uuid/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/email/post-uuid/]
@ -1576,7 +1576,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-6/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -1697,7 +1697,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-6/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-6/]
@ -2157,7 +2157,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-7/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -2278,7 +2278,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-7/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-7/]
@ -3277,7 +3277,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<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: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -3398,7 +3398,7 @@ This is a test post title [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
@ -4932,7 +4932,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-4/#ghost-comments\\" class=\\"comment-link\\" valign=\\"middle\\" style=\\"text-decoration: none; color: #738a94; font-size: 13px; letter-spacing: 0.1px; overflow-wrap: anywhere;\\" target=\\"_blank\\">
&#x2022; <img src=\\"https://static.ghost.org/v5.0.0/images/comment-icon.png\\" border=\\"0\\" width=\\"16\\" height=\\"16\\" alt=\\"Comment\\" style=\\"border: none; -ms-interpolation-mode: bicubic; max-width: 100%; width: 16px; height: 16px; margin-bottom: 1px; vertical-align: middle;\\">
</a>
@ -5095,7 +5095,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-4/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
[http://127.0.0.1:2369/this-is-a-test-post-title-4/#ghost-comments]
@ -5613,7 +5613,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-3/#ghost-comments\\" class=\\"comment-link\\" valign=\\"middle\\" style=\\"text-decoration: none; color: #738a94; font-size: 13px; letter-spacing: 0.1px; overflow-wrap: anywhere;\\" target=\\"_blank\\">
&#x2022; <img src=\\"https://static.ghost.org/v5.0.0/images/comment-icon.png\\" border=\\"0\\" width=\\"16\\" height=\\"16\\" alt=\\"Comment\\" style=\\"border: none; -ms-interpolation-mode: bicubic; max-width: 100%; width: 16px; height: 16px; margin-bottom: 1px; vertical-align: middle;\\">
</a>
@ -5758,7 +5758,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-3/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
[http://127.0.0.1:2369/this-is-a-test-post-title-3/#ghost-comments]
@ -5841,6 +5841,726 @@ https://ghost.org/
 
",
}
`;
exports[`Batch sending tests Newsletter settings Shows 3 latest posts 1 1`] = `
Object {
"html": "<!doctype html>
<html>
<head>
<meta name=\\"viewport\\" content=\\"width=device-width\\">
<meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=UTF-8\\">
<!--[if mso]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch><o:AllowPNG/></o:OfficeDocumentSettings></xml><![endif]-->
<title>This is the main post title</title>
<style>
.post-title-link {
color: #15212A;
display: block;
text-align: center;
margin-top: 50px;
}
.post-title-link-left {
text-align: left;
}
.comment-link {
color: #738a94;
font-size: 13px;
letter-spacing: 0.1px;
}
.comment-link img {
width: 16px;
height: 16px;
margin-bottom: 1px;
vertical-align: middle;
}
.view-online-link {
word-wrap: none;
white-space: nowrap;
color: #738a94;
}
.kg-nft-link {
display: block;
text-decoration: none !important;
color: #15212A !important;
font-family: inherit !important;
font-size: 14px;
line-height: 1.3em;
padding-top: 4px;
padding-right: 20px;
padding-left: 20px;
padding-bottom: 4px;
}
.kg-twitter-link {
display: block;
text-decoration: none !important;
color: #15212A !important;
font-family: inherit !important;
font-size: 15px;
padding: 8px;
line-height: 1.3em;
}
@media only screen and (max-width: 620px) {
table.body {
width: 100%;
min-width: 100%;
}
table.body p,
table.body ul,
table.body ol,
table.body td,
table.body span {
font-size: 16px !important;
}
table.body pre {
white-space: pre-wrap !important;
word-break: break-word !important;
}
table.body .content {
padding: 0 !important;
}
table.body .container {
padding: 0 !important;
width: 100% !important;
}
table.body .main {
border-spacing: 10px 0 !important;
border-left-width: 0 !important;
border-radius: 0 !important;
border-right-width: 0 !important;
}
table.body .btn table {
width: 100% !important;
}
table.body .btn a {
width: 100% !important;
}
table.body .img-responsive {
height: auto !important;
max-width: 100% !important;
width: auto !important;
}
table.body .site-icon img {
width: 40px !important;
height: 40px !important;
}
table.body .site-url a {
font-size: 14px !important;
padding-bottom: 15px !important;
}
table.body .post-meta,
table.body .post-meta-date {
white-space: normal !important;
font-size: 12px !important;
line-height: 1.5em;
}
table.body .post-meta,
table.body .view-online {
display: inline-block;
}
table.body .post-meta-left {
display: inline-block !important;
width: 100% !important;
text-align: left !important;
}
table.body .post-meta-left.view-online {
display: inline-block !important;
width: 100% !important;
text-align: left !important;
}
table.body .post-meta.author-date {
width: 100%;
}
table.body .view-online {
text-decoration: underline;
}
table.body .view-online-link,
table.body .comment-link,
table.body .footer,
table.body .footer a {
font-size: 12px !important;
}
table.body .post-title a {
font-size: 32px !important;
line-height: 1.15em !important;
}
table.feedback-buttons {
display: none !important;
}
table.feedback-buttons-mobile {
display: table !important;
width: 100% !important;
max-width: 390px;
}
table.body .feedback-button-mobile-text {
font-size: 13px !important;
}
table.body .latest-posts-header {
font-size: 14px !important;
}
table.body .latest-post a {
height: auto !important;
padding: 0 !important;
}
table.body .latest-post-img {
display: none !important;
}
table.body .latest-post-img-mobile {
display: inline-block !important;
width: 100%;
}
table.body .latest-post-title {
display: inline-block !important;
width: 100%;
padding-right: 0 !important;
padding-bottom: 8px !important;
}
table.body .latest-post h4 {
padding: 4px 0 !important;
font-size: 18px !important;
}
table.body .latest-post p {
font-size: 13px !important;
line-height: 1.25em;
}
table.body .subscription-box h3 {
font-size: 14px !important;
}
table.body .subscription-box p,
table.body .subscription-box p span {
font-size: 13px !important;
}
table.body .subscription-details,
table.body .manage-subscription {
display: inline-block;
width: 100%;
text-align: left !important;
font-size: 13px !important;
}
table.body .subscription-details {
padding-bottom: 12px;
}
table.body .kg-bookmark-card {
width: 90vw;
}
table.body .kg-bookmark-thumbnail {
display: none !important;
}
table.body .kg-bookmark-metadata span {
font-size: 13px !important;
}
table.body .kg-embed-card {
max-width: 90vw !important;
}
table.body h1 {
font-size: 32px !important;
line-height: 1.3em !important;
}
table.body h2 {
font-size: 26px !important;
line-height: 1.22em !important;
}
table.body h3 {
font-size: 21px !important;
line-height: 1.25em !important;
}
table.body h4 {
font-size: 19px !important;
line-height: 1.3em !important;
}
table.body h5 {
font-size: 16px !important;
line-height: 1.4em !important;
}
table.body h6 {
font-size: 16px !important;
line-height: 1.4em !important;
}
table.body blockquote {
font-size: 17px;
line-height: 1.6em;
margin-bottom: 0;
padding-left: 15px;
}
table.body blockquote.kg-blockquote-alt {
border-left: 0 none !important;
margin: 0 0 2.5em 0 !important;
padding: 0 50px 0 50px !important;
font-size: 1.2em;
}
table.body blockquote + * {
margin-top: 1.5em !important;
}
table.body hr {
margin: 2em 0 !important;
}
table.body figcaption,
table.body figcaption a {
font-size: 13px !important;
}
}
@media all {
.subscription-details p.hidden {
display: none !important;
}
.ExternalClass {
width: 100%;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
.apple-link a {
color: inherit !important;
font-family: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
text-decoration: none !important;
}
#MessageViewBody a {
color: inherit;
text-decoration: none;
font-size: inherit;
font-family: inherit;
font-weight: inherit;
line-height: inherit;
}
.btn-primary table td:hover {
background-color: #34495e !important;
}
.btn-primary a:hover {
background-color: #34495e !important;
border-color: #34495e !important;
}
}
</style>
</head>
<body style=\\"background-color: #fff; 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;; -webkit-font-smoothing: antialiased; font-size: 18px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #15212A;\\">
<span class=\\"preheader\\" style=\\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\\">Hello world</span>
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" class=\\"body\\" width=\\"100%\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #fff; width: 100%;\\" bgcolor=\\"#fff\\">
<!-- Outlook doesn't respect max-width so we need an extra centered table -->
<!--[if mso]>
<tr>
<td>
<center>
<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" width=\\"600\\">
<![endif]-->
<tr>
<td 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;; font-size: 18px; vertical-align: top; color: #15212A;\\" valign=\\"top\\">&#xA0;</td>
<td class=\\"container\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; display: block; max-width: 600px; margin: 0 auto;\\" valign=\\"top\\">
<div class=\\"content\\" style=\\"box-sizing: border-box; display: block; margin: 0 auto; max-width: 600px;\\">
<!-- START CENTERED WHITE CONTAINER -->
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" class=\\"main\\" width=\\"100%\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background: #ffffff; border-radius: 3px; border-spacing: 20px 0; width: 100%;\\">
<!-- START MAIN CONTENT AREA -->
<tr>
<td class=\\"wrapper\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; box-sizing: border-box;\\" valign=\\"top\\">
<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 class=\\"header-image-row\\">
<td class=\\"header-image\\" width=\\"100%\\" align=\\"center\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding-top: 24px;\\" valign=\\"top\\">
<img src=\\"http://127.0.0.1:2369/content/images/2022/05/test.jpg\\" style=\\"border: none; -ms-interpolation-mode: bicubic; max-width: 100%;\\">
</td>
</tr>
<tr>
<td class=\\"site-info-bordered\\" width=\\"100%\\" align=\\"center\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding-top: 50px; border-bottom: 1px solid #e5eff5;\\" valign=\\"top\\">
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td class=\\"site-url \\" 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; color: #15212A; font-size: 16px; letter-spacing: -0.1px; font-weight: 700; text-transform: uppercase; text-align: center;\\" valign=\\"top\\" align=\\"center\\"><div style=\\"width: 100% !important;\\"><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"site-title\\" style=\\"text-decoration: none; color: #15212A; overflow-wrap: anywhere;\\" target=\\"_blank\\">Ghost</a></div></td>
</tr>
<tr>
<td class=\\"site-url site-url-bottom-padding\\" 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; color: #15212A; font-size: 16px; letter-spacing: -0.1px; font-weight: 700; text-transform: uppercase; text-align: center; padding-bottom: 50px;\\" valign=\\"top\\" align=\\"center\\"><div style=\\"width: 100% !important;\\"><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"site-subtitle\\" style=\\"text-decoration: none; color: #8695a4; font-size: 14px; font-weight: 400; text-transform: none; overflow-wrap: anywhere;\\" target=\\"_blank\\">Daily newsletter</a></div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class=\\"post-title post-title-serif\\" style=\\"vertical-align: top; color: #15212A; padding-bottom: 16px; font-size: 42px; line-height: 1.1em; font-weight: 700; text-align: center; font-family: Georgia, serif; letter-spacing: -0.01em;\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" class=\\"post-title-link\\" style=\\"text-decoration: none; color: #15212A; display: block; text-align: center; margin-top: 50px; overflow-wrap: anywhere;\\" target=\\"_blank\\">This is the main post title</a>
</td>
</tr>
<tr>
<td 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;; font-size: 18px; vertical-align: top; color: #15212A;\\" valign=\\"top\\">
<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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<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: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
</td>
</tr>
</table>
</td>
</tr>
<tr class=\\"post-content-row\\">
<td class=\\"post-content\\" style=\\"vertical-align: top; font-family: Georgia, serif; font-size: 18px; line-height: 1.5em; color: #15212A; padding-bottom: 20px; border-bottom: 1px solid #e5eff5; max-width: 600px;\\" valign=\\"top\\">
<!-- POST CONTENT START -->
<p style=\\"margin: 0 0 1.5em 0; line-height: 1.6em;\\">Hello world</p>
<!-- POST CONTENT END -->
</td>
</tr>
</table>
</td>
</tr>
<!-- END MAIN CONTENT AREA -->
<tr>
<td 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;; font-size: 18px; vertical-align: top; color: #15212A; padding: 24px 0; border-bottom: 1px solid #e5eff5;\\" valign=\\"top\\">
<h3 class=\\"latest-posts-header\\" style=\\"margin-top: 0; 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;; line-height: 1.11em; text-rendering: optimizeLegibility; margin: 0; padding: 8px 0 16px; color: #15212A; font-size: 14px; font-weight: 700; text-transform: uppercase;\\">Keep reading</h3>
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td class=\\"latest-post\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding: 8px 0;\\" valign=\\"top\\">
<a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" style=\\"overflow-wrap: anywhere; display: block; overflow: hidden; color: inherit; text-decoration: none;\\" target=\\"_blank\\">
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td valign=\\"top\\" align=\\"left\\" class=\\"latest-post-title\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding-right: 12px;\\">
<h4 class style=\\"margin-top: 0; 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;; text-rendering: optimizeLegibility; line-height: 1.2em; margin: 0; padding: 2px 0 4px; font-size: 19px; font-weight: 700;\\">This is a test post title</h4>
<p style=\\"line-height: 1.6em; margin: 0; padding: 0; color: #738a94; font-size: 15px; font-weight: 400;\\">Hello world</p>
</td>
</tr>
</table>
</a>
</td>
</tr>
</table>
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td class=\\"latest-post\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding: 8px 0;\\" valign=\\"top\\">
<a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" style=\\"overflow-wrap: anywhere; display: block; overflow: hidden; color: inherit; text-decoration: none;\\" target=\\"_blank\\">
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td valign=\\"top\\" align=\\"left\\" class=\\"latest-post-title\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding-right: 12px;\\">
<h4 class style=\\"margin-top: 0; 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;; text-rendering: optimizeLegibility; line-height: 1.2em; margin: 0; padding: 2px 0 4px; font-size: 19px; font-weight: 700;\\">This is a test post title</h4>
<p style=\\"line-height: 1.6em; margin: 0; padding: 0; color: #738a94; font-size: 15px; font-weight: 400;\\">Hello world</p>
</td>
</tr>
</table>
</a>
</td>
</tr>
</table>
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td class=\\"latest-post\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding: 8px 0;\\" valign=\\"top\\">
<a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" style=\\"overflow-wrap: anywhere; display: block; overflow: hidden; color: inherit; text-decoration: none;\\" target=\\"_blank\\">
<table role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\\" width=\\"100%\\">
<tr>
<td valign=\\"top\\" align=\\"left\\" class=\\"latest-post-title\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; padding-right: 12px;\\">
<h4 class style=\\"margin-top: 0; 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;; text-rendering: optimizeLegibility; line-height: 1.2em; margin: 0; padding: 2px 0 4px; font-size: 19px; font-weight: 700;\\">This is a test post title</h4>
<p style=\\"line-height: 1.6em; margin: 0; padding: 0; color: #738a94; font-size: 15px; font-weight: 400;\\">Hello world</p>
</td>
</tr>
</table>
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class=\\"wrapper\\" align=\\"center\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; box-sizing: border-box;\\" valign=\\"top\\">
<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%; padding-top: 40px; padding-bottom: 30px;\\">
<tr>
<td class=\\"footer\\" 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; color: #738a94; margin-top: 20px; text-align: center; font-size: 13px; padding-bottom: 10px; padding-top: 10px; padding-left: 30px; padding-right: 30px; line-height: 1.5em;\\" valign=\\"top\\" align=\\"center\\">Ghost &#xA9; 2023 &#x2013; <a href=\\"http://127.0.0.1:2369/unsubscribe/?uuid=member-uuid&newsletter=requested-newsletter-uuid\\" style=\\"overflow-wrap: anywhere; color: #738a94; text-decoration: underline;\\" target=\\"_blank\\">Unsubscribe</a></td>
</tr>
<tr>
<td class=\\"footer-powered\\" 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;; font-size: 18px; vertical-align: top; color: #15212A; text-align: center; padding-top: 70px; padding-bottom: 40px;\\" valign=\\"top\\" align=\\"center\\"><a href=\\"http://127.0.0.1:2369/r/xxxxxx?m=member-uuid\\" style=\\"color: #FF1A75; text-decoration: none; overflow-wrap: anywhere;\\" target=\\"_blank\\"><img src=\\"https://static.ghost.org/v4.0.0/images/powered.png\\" border=\\"0\\" width=\\"142\\" height=\\"30\\" class=\\"gh-powered\\" alt=\\"Powered by Ghost\\" style=\\"border: none; -ms-interpolation-mode: bicubic; max-width: 100%; width: 142px; height: 30px;\\"></a></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- END CENTERED WHITE CONTAINER -->
</div>
</td>
<td 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;; font-size: 18px; vertical-align: top; color: #15212A;\\" valign=\\"top\\">&#xA0;</td>
</tr>
<!--[if mso]>
</table>
</center>
</td>
</tr>
<![endif]-->
</table>
</body>
</html>
",
}
`;
exports[`Batch sending tests Newsletter settings Shows 3 latest posts 2 1`] = `
Object {
"html": "
Hello world
 
Ghost [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
Daily newsletter [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
This is the main post title [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
Hello world
Keep reading
This is a test post title
Hello world
[http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
This is a test post title
Hello world
[http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
This is a test post title
Hello world
[http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
Ghost © 2023 Unsubscribe [http://127.0.0.1:2369/unsubscribe/?uuid=member-uuid&newsletter=requested-newsletter-uuid]
http://127.0.0.1:2369/r/xxxxxx?m=member-uuid
 
@ -7415,7 +8135,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-12/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -7556,7 +8276,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-12/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-12/]
@ -8051,7 +8771,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-9/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -8192,7 +8912,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-9/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-9/]
@ -8687,7 +9407,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-8/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -8828,7 +9548,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-8/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-8/]
@ -9323,7 +10043,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-11/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -9464,7 +10184,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-11/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-11/]
@ -9959,7 +10679,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-10/\\" class=\\"view-online-link\\" style=\\"text-decoration: none; word-wrap: none; white-space: nowrap; color: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -10100,7 +10820,7 @@ This is a test post title [http://127.0.0.1:2369/this-is-a-test-post-title-10/]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/this-is-a-test-post-title-10/]
@ -11231,7 +11951,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<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: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -11352,7 +12072,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
@ -11814,7 +12534,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%; padding-bottom: 48px;\\">
<tr>
<td class=\\"post-meta post-meta-center author-date\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; text-align: center; display: inline-block; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2023 </span>
By Joe Bloggs &#x2022; <span class=\\"post-meta-date\\" style=\\"white-space: nowrap;\\">1 Jan 2050 </span>
</td>
<td class=\\"post-meta post-meta-center view-online\\" 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; color: #738a94; font-size: 13px; letter-spacing: 0.1px; display: inline-block; text-align: center; text-decoration: underline; width: 100%;\\" width=\\"100%\\" valign=\\"top\\" align=\\"center\\">
<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: #738a94; overflow-wrap: anywhere;\\" target=\\"_blank\\">View in browser</a>
@ -11935,7 +12655,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]
By Joe Bloggs • 1 Jan 2023
By Joe Bloggs • 1 Jan 2050
View in browser [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid]

View File

@ -45,6 +45,8 @@ async function getDefaultNewsletter() {
return await models.Newsletter.findOne({slug: newsletterSlug});
}
let postCounter = 0;
async function createPublishedPostEmail(settings = {}, email_recipient_filter) {
const post = {
title: 'A random test post',
@ -64,11 +66,14 @@ async function createPublishedPostEmail(settings = {}, email_recipient_filter) {
const id = res.body.posts[0].id;
// Make sure all posts are published in the samre order, with minimum 1s difference (to have consistent ordering when including latests posts)
postCounter += 1;
const updatedPost = {
status: 'published',
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()
published_at: moment(new Date(2050, 0, 1, 12, 0, postCounter)).toISOString()
};
const newsletterSlug = fixtureManager.get('newsletters', 0).slug;
@ -1228,5 +1233,26 @@ describe('Batch sending tests', function () {
// undo
await models.Newsletter.edit({show_subscription_details: false}, {id: defaultNewsletter.id});
});
it('Shows 3 latest posts', async function () {
const defaultNewsletter = await getDefaultNewsletter();
await models.Newsletter.edit({show_latest_posts: true}, {id: defaultNewsletter.id});
const {html} = await sendEmail({
title: 'This is the main post title',
mobiledoc: mobileDocExample
});
// Check contains 3 latest posts
assert.match(html, /Keep reading/);
// Check count of title
assert.equal(html.match(/This is the main post title/g).length, 2, 'Should only contain the title two times'); // otherwise post is in last 3 posts
await lastEmailMatchSnapshot();
// undo
await models.Newsletter.edit({show_latest_posts: false}, {id: defaultNewsletter.id});
});
});
});

View File

@ -773,7 +773,7 @@ class EmailRenderer {
if (newsletter.get('show_latest_posts') && this.#labs.isSet('makingItRain')) {
// Fetch last 3 published posts
const {data} = await this.#models.Post.findPage({
filter: 'status:published',
filter: 'status:published+id:-' + post.id,
order: 'published_at DESC',
limit: 3
});