announcements: fix preview window

This commit is contained in:
Harvey Tindall
2021-11-10 20:04:04 +00:00
parent 2de7182c55
commit f78fa28822
3 changed files with 6 additions and 1 deletions
+3
View File
@@ -1931,6 +1931,8 @@ func (app *appContext) GetCustomEmails(gc *gin.Context) {
func (app *appContext) getCustomEmail(id string) *customEmail {
switch id {
case "Announcement":
return &customEmail{}
case "UserCreated":
return &app.storage.customEmails.UserCreated
case "InviteExpiry":
@@ -2041,6 +2043,7 @@ func (app *appContext) GetCustomEmailTemplate(gc *gin.Context) {
emailAddress := app.storage.lang.Email[lang].Strings.get("emailAddress")
email := app.getCustomEmail(id)
if email == nil {
app.err.Printf("Failed to get custom email with ID \"%s\"", id)
respondBool(400, false, gc)
return
}