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 {