From 28af26843a4833f5b4a4a3ca1ffe22a3178765a6 Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Thu, 13 Jun 2024 18:54:16 +0200 Subject: [PATCH] feat(messages): message mutes are enabled --- messages/main.go | 6 ++++++ 1 file changed, 6 insertions(+) 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