2016-04-05 16:27:32 +09:00
|
|
|
Comments.getNotificationProperties = function (comment, post) {
|
|
|
|
var commentAuthor = Meteor.users.findOne(comment.userId);
|
|
|
|
var properties = {
|
|
|
|
profileUrl: commentAuthor && commentAuthor.getProfileUrl(true),
|
|
|
|
postUrl: Posts.getPageUrl(post, true),
|
|
|
|
authorName : Comments.getAuthorName(comment),
|
|
|
|
postTitle: post.title,
|
|
|
|
htmlBody: comment.htmlBody,
|
|
|
|
commentUrl: Comments.getPageUrl(comment, true)
|
|
|
|
};
|
|
|
|
return properties;
|
|
|
|
};
|
|
|
|
|
2016-04-13 11:39:01 +09:00
|
|
|
// Telescope.notifications = Object.assign(Telescope.notifications, {
|
|
|
|
// newComment: {
|
|
|
|
// properties(data) {
|
|
|
|
// return Comments.getNotificationProperties(data.comment, data.post);
|
|
|
|
// },
|
|
|
|
// subject(properties) {
|
|
|
|
// return properties.authorName+' left a new comment on your post "' + properties.postTitle + '"';
|
|
|
|
// },
|
|
|
|
// emailTemplate: "newComment"
|
|
|
|
// },
|
2016-02-17 21:57:07 +09:00
|
|
|
|
2016-04-13 11:39:01 +09:00
|
|
|
// newReply: {
|
|
|
|
// properties(data) {
|
|
|
|
// return Comments.getNotificationProperties(data.comment, data.post);
|
|
|
|
// },
|
|
|
|
// subject(properties) {
|
|
|
|
// return properties.authorName+' replied to your comment on "'+properties.postTitle+'"';
|
|
|
|
// },
|
|
|
|
// emailTemplate: "newReply"
|
|
|
|
// },
|
2016-02-17 21:57:07 +09:00
|
|
|
|
2016-04-13 11:39:01 +09:00
|
|
|
// newCommentSubscribed: {
|
|
|
|
// properties(data) {
|
|
|
|
// return Comments.getNotificationProperties(data.comment, data.post);
|
|
|
|
// },
|
|
|
|
// subject(properties) {
|
|
|
|
// return properties.authorName+' left a new comment on "' + properties.postTitle + '"';
|
|
|
|
// },
|
|
|
|
// emailTemplate: "newComment"
|
|
|
|
// }
|
|
|
|
// });
|