diff --git a/apps/console/public/logos/probo.png b/apps/console/public/logos/probo.png new file mode 100644 index 000000000..6ef651e42 Binary files /dev/null and b/apps/console/public/logos/probo.png differ diff --git a/packages/emails/emails.go b/packages/emails/emails.go index 94f963674..07c35f2e1 100644 --- a/packages/emails/emails.go +++ b/packages/emails/emails.go @@ -26,6 +26,8 @@ import ( var Templates embed.FS const ( + logoURLFormat = "https://%s/logos/probo.png" + subjectConfirmEmail = "Confirm your email address" subjectPasswordReset = "Reset your password" subjectInvitation = "Invitation to join %s on Probo" @@ -52,97 +54,111 @@ var ( trustCenterAccessTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/trust-center-access.txt.tmpl")) ) -func RenderConfirmEmail(fullName, confirmationUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderConfirmEmail(hostname, fullName, confirmationUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string ConfirmationUrl string + LogoURL string }{ FullName: fullName, ConfirmationUrl: confirmationUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(confirmEmailTextTemplate, confirmEmailHTMLTemplate, data) return subjectConfirmEmail, textBody, htmlBody, err } -func RenderPasswordReset(fullName, resetUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderPasswordReset(hostname, fullName, resetUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string ResetUrl string + LogoURL string }{ FullName: fullName, ResetUrl: resetUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(passwordResetTextTemplate, passwordResetHTMLTemplate, data) return subjectPasswordReset, textBody, htmlBody, err } -func RenderInvitation(fullName, organizationName, invitationUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderInvitation(hostname, fullName, organizationName, invitationUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string OrganizationName string InvitationUrl string + LogoURL string }{ FullName: fullName, OrganizationName: organizationName, InvitationUrl: invitationUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(invitationTextTemplate, invitationHTMLTemplate, data) return fmt.Sprintf(subjectInvitation, organizationName), textBody, htmlBody, err } -func RenderDocumentSigning(fullName, organizationName, signingUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderDocumentSigning(hostname, fullName, organizationName, signingUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string OrganizationName string SigningUrl string + LogoURL string }{ FullName: fullName, OrganizationName: organizationName, SigningUrl: signingUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(documentSigningTextTemplate, documentSigningHTMLTemplate, data) return fmt.Sprintf(subjectDocumentSigning, organizationName), textBody, htmlBody, err } -func RenderDocumentExport(fullName, downloadUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderDocumentExport(hostname, fullName, downloadUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string DownloadUrl string + LogoURL string }{ FullName: fullName, DownloadUrl: downloadUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(documentExportTextTemplate, documentExportHTMLTemplate, data) return subjectDocumentExport, textBody, htmlBody, err } -func RenderFrameworkExport(fullName, downloadUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderFrameworkExport(hostname, fullName, downloadUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string DownloadUrl string + LogoURL string }{ FullName: fullName, DownloadUrl: downloadUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(frameworkExportTextTemplate, frameworkExportHTMLTemplate, data) return subjectFrameworkExport, textBody, htmlBody, err } -func RenderTrustCenterAccess(fullName, organizationName, accessUrl string) (subject string, textBody string, htmlBody *string, err error) { +func RenderTrustCenterAccess(hostname, fullName, organizationName, accessUrl string) (subject string, textBody string, htmlBody *string, err error) { data := struct { FullName string OrganizationName string AccessUrl string + LogoURL string }{ FullName: fullName, OrganizationName: organizationName, AccessUrl: accessUrl, + LogoURL: fmt.Sprintf(logoURLFormat, hostname), } textBody, htmlBody, err = renderEmail(trustCenterAccessTextTemplate, trustCenterAccessHTMLTemplate, data) diff --git a/packages/emails/src/components/ProboLogo.tsx b/packages/emails/src/components/ProboLogo.tsx index be689e0df..e9505267b 100644 --- a/packages/emails/src/components/ProboLogo.tsx +++ b/packages/emails/src/components/ProboLogo.tsx @@ -1,34 +1,13 @@ +import { Img } from '@react-email/components'; import * as React from 'react'; export function ProboLogo() { return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Probo ); } diff --git a/pkg/auth/service.go b/pkg/auth/service.go index b88bfe99e..a0618b8b7 100644 --- a/pkg/auth/service.go +++ b/pkg/auth/service.go @@ -191,6 +191,7 @@ func (s Service) ForgetPassword( } subject, textBody, htmlBody, err := emails.RenderPasswordReset( + s.hostname, user.FullName, resetPasswordUrl.String(), ) @@ -292,6 +293,7 @@ func (s Service) SignUp( } subject, textBody, htmlBody, err := emails.RenderConfirmEmail( + s.hostname, user.FullName, confirmationUrl.String(), ) diff --git a/pkg/authz/service.go b/pkg/authz/service.go index 658aa1995..40f1f9bbb 100644 --- a/pkg/authz/service.go +++ b/pkg/authz/service.go @@ -702,6 +702,7 @@ func (s *TenantAuthzService) InviteUserToOrganization( } subject, textBody, htmlBody, err := emails.RenderInvitation( + s.hostname, recipientName, organization.Name, invitationURL, diff --git a/pkg/probo/document_service.go b/pkg/probo/document_service.go index a8b93059e..85c493bde 100644 --- a/pkg/probo/document_service.go +++ b/pkg/probo/document_service.go @@ -455,6 +455,7 @@ func (s *DocumentService) SendSigningNotifications( } subject, textBody, htmlBody, err := emails.RenderDocumentSigning( + s.svc.hostname, people.FullName, organization.Name, signRequestURL.String(), @@ -1570,6 +1571,7 @@ func (s *DocumentService) SendExportEmail( } subject, textBody, htmlBody, err := emails.RenderDocumentExport( + s.svc.hostname, recipientName, downloadURL, ) diff --git a/pkg/probo/framework_service.go b/pkg/probo/framework_service.go index d97086e74..2522330bd 100644 --- a/pkg/probo/framework_service.go +++ b/pkg/probo/framework_service.go @@ -709,6 +709,7 @@ func (s FrameworkService) SendExportEmail( } subject, textBody, htmlBody, err := emails.RenderFrameworkExport( + s.svc.hostname, recipientName, downloadURL, ) diff --git a/pkg/probo/trust_center_access_service.go b/pkg/probo/trust_center_access_service.go index ac8ed1c99..9a42b8e56 100644 --- a/pkg/probo/trust_center_access_service.go +++ b/pkg/probo/trust_center_access_service.go @@ -408,6 +408,7 @@ func (s TrustCenterAccessService) sendTrustCenterAccessEmail( accessURL string, ) error { subject, textBody, htmlBody, err := emails.RenderTrustCenterAccess( + s.svc.hostname, name, companyName, accessURL,