Browse Source

Merge 78e06d4aaa into d96bbaf42c

pull/5862/merge
Dzhonn 1 week ago
committed by GitHub
parent
commit
b823d550a3
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 4 deletions
  1. 1
      README.md
  2. 32
      server/modules/comments/default/comment.js

1
README.md

@ -1,4 +1,5 @@
<div align="center">
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.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://static.requarks.io/logo/wikijs-full-darktheme.svg">

32
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
*/

Loading…
Cancel
Save