diff --git a/messages/main.go b/messages/main.go index d432a29..1ac790d 100644 --- a/messages/main.go +++ b/messages/main.go @@ -19,6 +19,12 @@ func sendEmailNotification(app *pocketbase.PocketBase, registry *template.Regist 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") // check if user has a valid email