feat(emailApi): added setAt Datetime field support for Email Model
Build and Push Docker image / build-and-push (push) Successful in 3m14s Details

This commit is contained in:
Valentin Kolb 2024-10-29 17:44:42 +01:00
parent 7e566798dd
commit 4d185f217b
1 changed files with 2 additions and 0 deletions

View File

@ -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 {