diff --git a/core/server/api/canary/email-preview.js b/core/server/api/canary/email-preview.js index 0101429471..000a08bea9 100644 --- a/core/server/api/canary/email-preview.js +++ b/core/server/api/canary/email-preview.js @@ -20,7 +20,7 @@ module.exports = { ], permissions: true, query(frame) { - const options = Object.assign(frame.options, {formats: 'html,plaintext'}); + const options = Object.assign(frame.options, {formats: 'html,plaintext', withRelated: ['authors']}); return models.Post.findOne(frame.data, options) .then((model) => { if (!model) { diff --git a/core/server/services/mega/post-email-serializer.js b/core/server/services/mega/post-email-serializer.js index 2d0a4f8f14..4c6a938875 100644 --- a/core/server/services/mega/post-email-serializer.js +++ b/core/server/services/mega/post-email-serializer.js @@ -12,6 +12,7 @@ const getSite = () => { const serialize = (post) => { post.published_at = post.published_at ? moment(post.published_at).format('DD MMM YYYY') : moment().format('DD MMM YYYY'); + post.authors = post.authors && post.authors.map(author => author.name).join(','); return { subject: post.email_subject || post.title, html: juice(template({post, site: getSite()})), diff --git a/core/server/services/mega/template.js b/core/server/services/mega/template.js index ddc06982cc..f2be4aa728 100644 --- a/core/server/services/mega/template.js +++ b/core/server/services/mega/template.js @@ -1,6 +1,6 @@ /* eslint indent: warn, no-irregular-whitespace: warn */ module.exports = ({post, site}) => { - const currentYear = new Date(); + const date = new Date(); return ` @@ -805,7 +805,7 @@ figure blockquote p {
- By Authors – + By ${post.authors} – ${post.published_at} – View online → | @@ -840,7 +840,7 @@ figure blockquote p {
|