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

37 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-04-13 12:34:41 +09:00
const getComment = (commentId) => {
return typeof Comments.findOne(commentId) === "undefined" ? Comments.findOne() : Comments.findOne(commentId);
};
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
}
});