restrict v8

This commit is contained in:
tamakyi
2026-10-18 23:32:38 +08:00
parent 317c96ca17
commit 7a6417c33d
21 changed files with 626 additions and 21 deletions
+15
View File
@@ -129,6 +129,21 @@ func SendAbuseAlertMail(domain, name string, count24, count7d int64) error {
return sendTemplateMail(conf.Security.SecurityAlertEmail, "【狼的提问箱】某箱主收到集中举报", templates.FS, "mail/abuse-alert.html", params)
}
// SendQuestionReportedMail 通知箱主「你的某条内容被多人举报」。
//
// 与给运维的告警不同:这封是给**箱主**的自查提醒,语气必须中性 ——
// 明确写出「不代表平台已判定违规」,避免变成变相的处罚通知。
func SendQuestionReportedMail(email, domain string, questionID uint, count int64, link string) error {
params := map[string]string{
"domain": domain,
"question_id": fmt.Sprintf("%d", questionID),
"count": fmt.Sprintf("%d", count),
"link": link,
"time": time.Now().Format("2006-01-02 15:04:05"),
}
return sendTemplateMail(email, "【狼的提问箱】你的内容被举报了", templates.FS, "mail/question-reported.html", params)
}
func sendTemplateMail(email, title string, templateFS embed.FS, templatePath string, params map[string]string) error {
var content bytes.Buffer
t, err := template.ParseFS(templateFS, templatePath)