From e8aabe18eb4ef2dfc39ec2a7e3b1fc9c3fe7b035 Mon Sep 17 00:00:00 2001 From: Dzhonn Date: Fri, 18 Nov 2022 13:25:59 +1000 Subject: [PATCH 1/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3b797156..2b3758ce 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@
+ Added the functionality of sending a letter to the author of the article about a new (deleted/updated) comments. The mail settings are taken from the standard module. Created a separate template for notification emails. Wiki.js From 78e06d4aaa9f79dc5899ba743c733f84b72dcdcf Mon Sep 17 00:00:00 2001 From: Dzhonn Date: Fri, 18 Nov 2022 13:28:52 +1000 Subject: [PATCH 2/2] Update comment.js --- server/modules/comments/default/comment.js | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/server/modules/comments/default/comment.js b/server/modules/comments/default/comment.js index fa819c8b..78017630 100644 --- a/server/modules/comments/default/comment.js +++ b/server/modules/comments/default/comment.js @@ -130,13 +130,37 @@ module.exports = { render: renderedContent }) return renderedContent + + }, - /** + + + + + + + + /** * Delete an existing comment by ID */ - async remove ({ id, user }) { - return WIKI.models.comments.query().findById(id).delete() - }, + async remove ({ id, page, Comment, content,authorId, user,config}) { + await WIKI.mail.send({ + template: 'coment', + to: page.authorEmail, + subject: `Коментарий удален`, + data: { + preheadertext: `ВАЖНО`, + title: user.name + ` удалил коментарий к статье: ` + page.title, + content: `Вы получили это сообщение потому что являетесь автором этой статьи`, + buttonLink: WIKI.config.host+`/`+page.path, + buttonText: 'Перейти к странице', + + }, + text: `Молодец ты нашел этот текст сообщи о своей находке и ни чего не произойдет ` + }) + return WIKI.models.comments.query().findById(id).delete() + }, + /** * Get the page ID from a comment ID */