Redesign trust center console

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-10-28 13:44:41 +01:00
parent abeaaec734
commit 1f0a5dff5c
39 changed files with 2308 additions and 2423 deletions

View File

@@ -19,7 +19,9 @@ import (
"embed"
"fmt"
htmltemplate "html/template"
"math"
texttemplate "text/template"
"time"
)
//go:embed dist
@@ -148,17 +150,21 @@ func RenderFrameworkExport(hostname, fullName, downloadUrl string) (subject stri
return subjectFrameworkExport, textBody, htmlBody, err
}
func RenderTrustCenterAccess(hostname, fullName, organizationName, accessUrl string) (subject string, textBody string, htmlBody *string, err error) {
func RenderTrustCenterAccess(hostname, fullName, organizationName, accessUrl string, tokenDuration time.Duration) (subject string, textBody string, htmlBody *string, err error) {
durationInDays := int(math.Round(tokenDuration.Hours() / 24))
data := struct {
FullName string
OrganizationName string
AccessUrl string
LogoURL string
DurationInDays int
}{
FullName: fullName,
OrganizationName: organizationName,
AccessUrl: accessUrl,
LogoURL: fmt.Sprintf(logoURLFormat, hostname),
DurationInDays: durationInDays,
}
textBody, htmlBody, err = renderEmail(trustCenterAccessTextTemplate, trustCenterAccessHTMLTemplate, data)

View File

@@ -16,7 +16,7 @@ export const TrustCenterAccess = () => {
</Section>
<Text style={footerText}>
This link will expire in 7 days.
This link will expire in {'{{.DurationInDays}}'} days.
</Text>
</EmailLayout>
);

View File

@@ -6,6 +6,6 @@ You have been granted access to {{.OrganizationName}}'s Trust Center! Click the
{{.AccessUrl}}
This link will expire in 7 days.
This link will expire in {{.DurationInDays}} days.
Probo Inc, 490 Post St, STE 640, San Francisco, CA, 94102, US