mirror of
https://github.com/lxsang/antd-web-apps
synced 2025-07-23 17:19:47 +02:00
support author notification
This commit is contained in:
@ -164,6 +164,10 @@ class QuickTalk {
|
||||
content: ta.value,
|
||||
},
|
||||
};
|
||||
if (this.options.author) {
|
||||
data.author =
|
||||
this.options.author.first + "@" + this.options.author.last;
|
||||
}
|
||||
this.request(this.options.api_uri + "/post", data, (ret) => {
|
||||
if (ret.result) {
|
||||
// TODO: more check goes here
|
||||
|
@ -111,7 +111,14 @@ function CommentController:post(...)
|
||||
rq.comment.id = self.comment.db:lastInsertID()
|
||||
|
||||
rq.comment.content = process_md(rq.comment.content)
|
||||
|
||||
-- notify the author
|
||||
if rq.author then
|
||||
sendmail(rq.author, rq.comment.name ..
|
||||
" has commented on one of your pages",
|
||||
rq.comment.name .. " has commented on your page: " ..
|
||||
rq.page.uri ..
|
||||
".\nBest regards,\nEmail automatically sent by QuickTalk API")
|
||||
end
|
||||
-- send mail to all users of current page
|
||||
local cmts, cmti = self.comment:select("MIN(id) as id,email",
|
||||
"pid=" .. rq.comment.pid ..
|
||||
@ -125,7 +132,7 @@ function CommentController:post(...)
|
||||
rq.comment.name ..
|
||||
" has written something on a page that you've commented. \nPlease visit this page: " ..
|
||||
rq.page.uri ..
|
||||
" for updates on the discussion.\nBest regard,\nEmail automatically sent by QuickTalk API")
|
||||
" for updates on the discussion.\nBest regards,\nEmail automatically sent by QuickTalk API")
|
||||
end
|
||||
end
|
||||
rq.comment.email = ""
|
||||
|
Reference in New Issue
Block a user