Vulcan/packages/nova-comments/lib/emails.js

39 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-06-23 12:17:39 +09:00
import Comments from './collection.js';
2016-04-13 12:34:41 +09:00
const getComment = (commentId) => {
return typeof Comments.findOne(commentId) === "undefined" ? {comment: Comments.findOne()} : {comment: Comments.findOne(commentId)};
2016-04-13 12:34:41 +09:00
};
Telescope.email.addEmails({
2016-04-13 11:39:01 +09:00
newComment: {
template: "newComment",
path: "/email/new-comment/:_id?",
getProperties: Comments.getNotificationProperties,
subject({authorName = "[authorName]", postTitle = "[postTitle]"}) {
return authorName+' left a new comment on your post "' + postTitle + '"';
},
2016-04-13 12:34:41 +09:00
getTestObject: getComment
2016-04-13 11:39:01 +09:00
},
newReply: {
template: "newReply",
path: "/email/new-reply/:_id?",
getProperties: Comments.getNotificationProperties,
subject({authorName = "[authorName]", postTitle = "[postTitle]"}) {
return authorName+' replied to your comment on "'+postTitle+'"';
},
2016-04-13 12:34:41 +09:00
getTestObject: getComment
2016-04-13 11:39:01 +09:00
},
newCommentSubscribed: {
template: "newComment",
path: "/email/new-comment-subscribed/:_id?",
getProperties: Comments.getNotificationProperties,
subject({authorName = "[authorName]", postTitle = "[postTitle]"}) {
return authorName+' left a new comment on "' + postTitle + '"';
},
2016-04-13 12:34:41 +09:00
getTestObject: getComment
2016-04-13 11:39:01 +09:00
}
});