Tweak email formatting for chat room reports
This commit is contained in:
parent
8ac63bf800
commit
d37ab56f26
|
@ -67,6 +67,9 @@ func Report() http.HandlerFunc {
|
|||
|
||||
// Get the report out.
|
||||
report := req.Report
|
||||
if report.Comment == "" {
|
||||
report.Comment = "(no comment)"
|
||||
}
|
||||
|
||||
log.Debug("Got chat report: %+v", report)
|
||||
|
||||
|
@ -95,8 +98,11 @@ func Report() http.HandlerFunc {
|
|||
}
|
||||
|
||||
// Get the Reply-To user if possible.
|
||||
if user, err := models.FindUser(report.FromUsername); err == nil {
|
||||
fb.UserID = user.ID
|
||||
currentUser, err := models.FindUser(report.FromUsername)
|
||||
if err == nil {
|
||||
fb.UserID = currentUser.ID
|
||||
} else {
|
||||
currentUser = nil
|
||||
}
|
||||
|
||||
// Save the feedback.
|
||||
|
@ -107,13 +113,14 @@ func Report() http.HandlerFunc {
|
|||
// Email the admins.
|
||||
if err := mail.Send(mail.Message{
|
||||
To: config.Current.AdminEmail,
|
||||
Subject: "Chat Room Report",
|
||||
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": "Please check on the admin dashboard of nonshy.com",
|
||||
"Message": fb.Message,
|
||||
"CurrentUser": currentUser,
|
||||
"BaseURL": config.Current.BaseURL,
|
||||
"AdminURL": config.Current.BaseURL + "/admin/feedback",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user