mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added date formatting for email post data
no issue
This commit is contained in:
parent
3023619ac9
commit
686e0143c7
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@ const juice = require('juice');
|
||||||
const template = require('./template');
|
const template = require('./template');
|
||||||
const settingsCache = require('../../services/settings/cache');
|
const settingsCache = require('../../services/settings/cache');
|
||||||
const urlUtils = require('../../lib/url-utils');
|
const urlUtils = require('../../lib/url-utils');
|
||||||
|
const moment = require('moment');
|
||||||
|
|
||||||
const getSite = () => {
|
const getSite = () => {
|
||||||
return Object.assign({}, settingsCache.getPublic(), {
|
return Object.assign({}, settingsCache.getPublic(), {
|
||||||
|
@ -10,6 +11,7 @@ const getSite = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const serialize = (post) => {
|
const serialize = (post) => {
|
||||||
|
post.published_at = post.published_at ? moment(post.published_at).format('DD MMM YYYY') : moment().format('DD MMM YYYY');
|
||||||
return {
|
return {
|
||||||
subject: post.email_subject || post.title,
|
subject: post.email_subject || post.title,
|
||||||
html: juice(template({post, site: getSite()})),
|
html: juice(template({post, site: getSite()})),
|
||||||
|
|
Loading…
Add table
Reference in a new issue