feat(messages): message mutes are enabled

This commit is contained in:
Valentin Kolb 2024-06-13 18:54:16 +02:00
parent a95ad8a702
commit 28af26843a
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,12 @@ func sendEmailNotification(app *pocketbase.PocketBase, registry *template.Regist
return return
} }
// don't send email notification if user has muted email notifications and message is not an announcement
if user.GetBool("muteEmailNotifications") && !message.GetBool("isAnnouncement") {
return
}
// get user email
userEmail := user.GetString("email") userEmail := user.GetString("email")
// check if user has a valid email // check if user has a valid email