Don't spam admins with chat room reports
This commit is contained in:
parent
f8487f92e7
commit
47859ee204
|
@ -7,7 +7,6 @@ import (
|
||||||
"code.nonshy.com/nonshy/website/pkg/config"
|
"code.nonshy.com/nonshy/website/pkg/config"
|
||||||
"code.nonshy.com/nonshy/website/pkg/controller/api"
|
"code.nonshy.com/nonshy/website/pkg/controller/api"
|
||||||
"code.nonshy.com/nonshy/website/pkg/log"
|
"code.nonshy.com/nonshy/website/pkg/log"
|
||||||
"code.nonshy.com/nonshy/website/pkg/mail"
|
|
||||||
"code.nonshy.com/nonshy/website/pkg/models"
|
"code.nonshy.com/nonshy/website/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -110,24 +109,6 @@ func Report() http.HandlerFunc {
|
||||||
log.Error("Couldn't save feedback from BareRTC report endpoint: %s", err)
|
log.Error("Couldn't save feedback from BareRTC report endpoint: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Email the admins.
|
|
||||||
if err := mail.Send(mail.Message{
|
|
||||||
To: config.Current.AdminEmail,
|
|
||||||
Subject: "User Feedback: Chat Room Report",
|
|
||||||
Template: "email/contact_admin.html",
|
|
||||||
Data: map[string]interface{}{
|
|
||||||
"Title": "Chat Room Report",
|
|
||||||
"Intent": fb.Intent,
|
|
||||||
"Subject": fb.Subject,
|
|
||||||
"Message": fb.Message,
|
|
||||||
"CurrentUser": currentUser,
|
|
||||||
"BaseURL": config.Current.BaseURL,
|
|
||||||
"AdminURL": config.Current.BaseURL + "/admin/feedback",
|
|
||||||
},
|
|
||||||
}); err != nil {
|
|
||||||
log.Error("/v1/barertc/report page: couldn't send email: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send success response.
|
// Send success response.
|
||||||
api.SendJSON(w, http.StatusOK, Response{
|
api.SendJSON(w, http.StatusOK, Response{
|
||||||
OK: true,
|
OK: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user