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.
|
// Get the report out.
|
||||||
report := req.Report
|
report := req.Report
|
||||||
|
if report.Comment == "" {
|
||||||
|
report.Comment = "(no comment)"
|
||||||
|
}
|
||||||
|
|
||||||
log.Debug("Got chat report: %+v", report)
|
log.Debug("Got chat report: %+v", report)
|
||||||
|
|
||||||
|
@ -95,8 +98,11 @@ func Report() http.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the Reply-To user if possible.
|
// Get the Reply-To user if possible.
|
||||||
if user, err := models.FindUser(report.FromUsername); err == nil {
|
currentUser, err := models.FindUser(report.FromUsername)
|
||||||
fb.UserID = user.ID
|
if err == nil {
|
||||||
|
fb.UserID = currentUser.ID
|
||||||
|
} else {
|
||||||
|
currentUser = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the feedback.
|
// Save the feedback.
|
||||||
|
@ -107,13 +113,14 @@ func Report() http.HandlerFunc {
|
||||||
// Email the admins.
|
// Email the admins.
|
||||||
if err := mail.Send(mail.Message{
|
if err := mail.Send(mail.Message{
|
||||||
To: config.Current.AdminEmail,
|
To: config.Current.AdminEmail,
|
||||||
Subject: "Chat Room Report",
|
Subject: "User Feedback: Chat Room Report",
|
||||||
Template: "email/contact_admin.html",
|
Template: "email/contact_admin.html",
|
||||||
Data: map[string]interface{}{
|
Data: map[string]interface{}{
|
||||||
"Title": "Chat Room Report",
|
"Title": "Chat Room Report",
|
||||||
"Intent": fb.Intent,
|
"Intent": fb.Intent,
|
||||||
"Subject": fb.Subject,
|
"Subject": fb.Subject,
|
||||||
"Message": "Please check on the admin dashboard of nonshy.com",
|
"Message": fb.Message,
|
||||||
|
"CurrentUser": currentUser,
|
||||||
"BaseURL": config.Current.BaseURL,
|
"BaseURL": config.Current.BaseURL,
|
||||||
"AdminURL": config.Current.BaseURL + "/admin/feedback",
|
"AdminURL": config.Current.BaseURL + "/admin/feedback",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user