Redesign trust center console
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user