Base url defined : GWM

This commit is contained in:
Gowtham M 2025-08-05 12:08:35 +05:30
parent f9d43d2055
commit 55ac568d98

21
main.go
View File

@ -34,6 +34,8 @@ import (
"google.golang.org/api/option"
)
const baseUrl = "https://pb.venbait.in"
type EmailConfigurationResponse struct {
Page int `json:"page"`
PerPage int `json:"perPage"`
@ -615,7 +617,7 @@ func main() {
// Send email
subject := "Reset your FCSC password"
// resetURL := fmt.Sprintf("%s/api/auth/reset-password?token=%s", baseUrl, token)
//https://fcscapp.onelink.me/forgot-password/surendar.m@venbainfotech.com
resetURL := fmt.Sprintf("https://fcscapp.onelink.me/forgot-password/%s", email)
body := fmt.Sprintf(`
@ -1637,7 +1639,7 @@ func main() {
subject := "FCSC Verify Your Email to Complete Registration"
// Generate a verification URL (example: using user ID or token)
verificationURL := fmt.Sprintf("https://pb.venbait.in/verify-email?userId=%s", userID)
verificationURL := fmt.Sprintf("%s/verify-email?userId=%s", baseUrl, userID)
// Email body
body := fmt.Sprintf(`
@ -2286,8 +2288,6 @@ func main() {
}
}
const baseUrl = "https://pb.venbait.in"
// generateOTP generates a random 4-digit OTP
func generateOTP() (int, error) {
max := big.NewInt(10000) // 4-digit numbers range: 0000 to 9999
@ -2451,6 +2451,7 @@ func verifyEmailHandler(c echo.Context) error {
}
func sendAdminEmail(app *pocketbase.PocketBase, userID, username, userEmail string) error {
adminName := "Admin"
subject := "New User Registration Pending Review"
@ -2500,8 +2501,8 @@ func sendAdminEmail(app *pocketbase.PocketBase, userID, username, userEmail stri
Please review the registration and take appropriate action.
<br><br>
<div style="text-align: left; direction: ltr;">
<a href="https://pb.venbait.in/api/custom/approve?userId=%s" style="display: inline-block;background-color: green; color: white; padding: 5px 10px; border: none; cursor: pointer; border-radius:4px; font-size: 10px;">Approve </a>
<a href="https://pb.venbait.in/api/custom/reject?userId=%s" style="display: inline-block;background-color: red; color: white; padding: 5px 10px; border: none; cursor: pointer; border-radius:4px; font-size: 10px;">Reject </a>
<a href="%s/api/custom/approve?userId=%s" style="display: inline-block;background-color: green; color: white; padding: 5px 10px; border: none; cursor: pointer; border-radius:4px; font-size: 10px;">Approve </a>
<a href="%s/api/custom/reject?userId=%s" style="display: inline-block;background-color: red; color: white; padding: 5px 10px; border: none; cursor: pointer; border-radius:4px; font-size: 10px;">Reject </a>
</div>
</td>
<td align="right" style="width: 44%%; vertical-align: top; direction: rtl; text-align: right;">
@ -2514,8 +2515,8 @@ func sendAdminEmail(app *pocketbase.PocketBase, userID, username, userEmail stri
يرجى مراجعة التسجيل واتخاذ الإجراء المناسب.<br><br>
<div style="text-align: right; direction: rtl;">
<a href="https://pb.venbait.in/api/custom/approve?userId=%s" style="display: inline-block; background-color: green; color: white; padding: 5px 10px; border: none;cursor: pointer; border-radius: 4px; font-size: 10px; text-decoration: none;">Approve </a>
<a href="https://pb.venbait.in/api/custom/reject?userId=%s" style="display: inline-block; background-color: red; color: white; padding: 5px 10px; border: none;cursor: pointer; border-radius: 4px; font-size: 10px; text-decoration: none; margin-left: 8px;">Reject </a>
<a href="%s/api/custom/approve?userId=%s" style="display: inline-block; background-color: green; color: white; padding: 5px 10px; border: none;cursor: pointer; border-radius: 4px; font-size: 10px; text-decoration: none;">Approve </a>
<a href="%s/api/custom/reject?userId=%s" style="display: inline-block; background-color: red; color: white; padding: 5px 10px; border: none;cursor: pointer; border-radius: 4px; font-size: 10px; text-decoration: none; margin-left: 8px;">Reject </a>
</div>
</td>
</tr>
@ -2541,8 +2542,8 @@ func sendAdminEmail(app *pocketbase.PocketBase, userID, username, userEmail stri
</body>
</html>
`,
adminName, username, userEmail, userEmail, userID, userID,
adminName, username, userEmail, userEmail, userID, userID)
adminName, username, userEmail, userEmail, baseUrl, userID, baseUrl, userID,
adminName, username, userEmail, userEmail, baseUrl, userID, baseUrl, userID)
// Send email
message := &mailer.Message{