mirror of
https://github.com/vale981/Vulcan
synced 2025-03-11 13:06:41 -04:00
26 lines
968 B
JavaScript
26 lines
968 B
JavaScript
|
|
// New comment email
|
|
Picker.route('/email/new-comment/:id?', function(params, req, res, next) {
|
|
var html;
|
|
var comment = typeof params.id === "undefined" ? Comments.findOne() : Comments.findOne(params.id);
|
|
var post = Posts.findOne(comment.postId);
|
|
if (!!comment) {
|
|
html = Telescope.email.getTemplate('emailNewComment')(Comments.getNotificationProperties(comment, post));
|
|
} else {
|
|
html = "<h3>No post found.</h3>"
|
|
}
|
|
res.end(Telescope.email.buildTemplate(html));
|
|
});
|
|
|
|
// New reply email
|
|
Picker.route('/email/new-reply/:id?', function(params, req, res, next) {
|
|
var html;
|
|
var comment = typeof params.id === "undefined" ? Comments.findOne() : Comments.findOne(params.id);
|
|
var post = Posts.findOne(comment.postId);
|
|
if (!!comment) {
|
|
html = Telescope.email.getTemplate('emailNewReply')(Comments.getNotificationProperties(comment, post));
|
|
} else {
|
|
html = "<h3>No post found.</h3>"
|
|
}
|
|
res.end(Telescope.email.buildTemplate(html));
|
|
});
|