From 4d185f217b803139bd508ad33d1d04547149618f Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Tue, 29 Oct 2024 17:44:42 +0100 Subject: [PATCH] feat(emailApi): added setAt Datetime field support for Email Model --- emailApi/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emailApi/main.go b/emailApi/main.go index 8c13c9f..2d570fb 100644 --- a/emailApi/main.go +++ b/emailApi/main.go @@ -10,6 +10,7 @@ import ( "github.com/pocketbase/pocketbase/tools/mailer" "github.com/pocketbase/pocketbase/tools/template" "net/mail" + "time" ) // sendEmailToUser sends an email notification to a recipient of the email record @@ -113,6 +114,7 @@ func sendEmails(app *pocketbase.PocketBase, emailRecord *models.Record) { // mark email as sent emailRecord.Set("sentTo", sendToIds) + emailRecord.Set("sentAt", time.Now()) // save email record if err := app.Dao().SaveRecord(emailRecord); err != nil {