emails: fix and confirm function of all emails

both custom and standard emails tested, quite a few fixes made,
including to an old bug with admin notifs.
This commit is contained in:
Harvey Tindall
2025-08-31 17:12:50 +01:00
parent 60dbfa2d1e
commit e67f1bf1a9
12 changed files with 135 additions and 125 deletions
+2 -2
View File
@@ -124,7 +124,7 @@ func (app *appContext) deleteExpiredInvite(data Invite) {
func (app *appContext) sendAdminExpiryNotification(data Invite) *sync.WaitGroup {
notify := data.Notify
if !emailEnabled || !app.config.Section("notifications").Key("enabled").MustBool(false) || len(notify) != 0 {
if !emailEnabled || !app.config.Section("notifications").Key("enabled").MustBool(false) || len(notify) == 0 {
return nil
}
var wait sync.WaitGroup
@@ -283,7 +283,7 @@ func (app *appContext) GetInviteCount(gc *gin.Context) {
// @Summary Get the number of invites stored in the database that have been used (but are still valid).
// @Produce json
// @Success 200 {object} PageCountDTO
// @Router /invites/count [get]
// @Router /invites/count/used [get]
// @Security Bearer
// @tags Invites
func (app *appContext) GetInviteUsedCount(gc *gin.Context) {