send email on successful password change
This commit is contained in:
@@ -197,6 +197,17 @@ func changePasswordHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte(`{"success": true}`))
|
||||
|
||||
data := map[string]any{
|
||||
"Username": userData[sessionData.UserID].DisplayName,
|
||||
"ServiceName": "Astral Tech",
|
||||
}
|
||||
|
||||
email_template, err := email.RenderTemplate("./data/email-templates/changed-password.html", data, nil)
|
||||
if err != nil {
|
||||
logging.Errorf("Failed to load email template: %s", err.Error())
|
||||
}
|
||||
noReplyEmail.SendEmail([]string{userData[sessionData.UserID].Email}, "Password expired", email_template)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user