[#275] added support to customize the default user email templates from the Admin UI

This commit is contained in:
Gani Georgiev
2022-08-14 19:30:45 +03:00
parent 1de56d3d9e
commit 7d10d20de1
47 changed files with 1648 additions and 1188 deletions

View File

@@ -3,12 +3,12 @@ package mails
import (
"fmt"
"net/mail"
"strings"
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/mails/templates"
"github.com/pocketbase/pocketbase/models"
"github.com/pocketbase/pocketbase/tokens"
"github.com/pocketbase/pocketbase/tools/rest"
)
// SendAdminPasswordReset sends a password reset request email to the specified admin.
@@ -18,9 +18,9 @@ func SendAdminPasswordReset(app core.App, admin *models.Admin) error {
return tokenErr
}
actionUrl, urlErr := normalizeUrl(fmt.Sprintf(
actionUrl, urlErr := rest.NormalizeUrl(fmt.Sprintf(
"%s/_/#/confirm-password-reset/%s",
strings.TrimSuffix(app.Settings().Meta.AppUrl, "/"),
app.Settings().Meta.AppUrl,
token,
))
if urlErr != nil {