diff --git a/main.go b/main.go index bb036b6..fe2792f 100644 --- a/main.go +++ b/main.go @@ -336,6 +336,7 @@ func TranslateFilters(app *pocketbase.PocketBase, dataset string, filterGroups [ var app *pocketbase.PocketBase func main() { + const baseUrl = "https://pb.venbait.in" app = pocketbase.New() @@ -670,10 +671,23 @@ func main() { app.OnRecordAfterCreateRequest().Add(func(e *core.RecordCreateEvent) error { if e.Record.Collection().Name == "users" { // Retrieve user details - name := e.Record.GetString("username") + name := e.Record.GetString("uname") email := e.Record.GetString("email") userID := e.Record.Id // User ID + imageRecord, err := app.Dao().FindFirstRecordByData("images", "file_name", "app_logo") + if err != nil { + log.Printf("Failed to fetch logo from images collection: %v", err) + return nil + } + + // Construct the logo URL + logoURL := fmt.Sprintf("%s/api/files/images/%s/%s", + baseUrl, + imageRecord.Id, + imageRecord.GetString("file"), + ) + // Email subject subject := "Please Verify Your Email Address" @@ -690,9 +704,12 @@ func main() { Verify Email
If you did not register for this account, please ignore this email.
+ +Best regards,
+