Skip to content

Commit

Permalink
Added date formatting for email post data
Browse files Browse the repository at this point in the history
no issue
  • Loading branch information
rishabhgrg committed Nov 6, 2019
1 parent 3023619 commit 686e014
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/server/services/mega/post-email-serializer.js
Expand Up @@ -2,6 +2,7 @@ const juice = require('juice');
const template = require('./template');
const settingsCache = require('../../services/settings/cache');
const urlUtils = require('../../lib/url-utils');
const moment = require('moment');

const getSite = () => {
return Object.assign({}, settingsCache.getPublic(), {
Expand All @@ -10,6 +11,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');
return {
subject: post.email_subject || post.title,
html: juice(template({post, site: getSite()})),
Expand Down

0 comments on commit 686e014

Please sign in to comment.