From e008e66a515dd9fb8e642136be80121908083150 Mon Sep 17 00:00:00 2001
From: venbaittech
Date: Fri, 24 Jan 2025 17:01:30 +0530
Subject: [PATCH] logo and username change
---
main.go | 92 +++++++++++++++++++++++++++++++++++++-------
pb_data/config.json | 3 ++
pb_data/logs.db | Bin 770048 -> 770048 bytes
3 files changed, 82 insertions(+), 13 deletions(-)
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,
+