diff --git a/backend/resources/email-templates/api-key-expiring-soon_html.tmpl b/backend/resources/email-templates/api-key-expiring-soon_html.tmpl index 861fdfc4..ba102b29 100644 --- a/backend/resources/email-templates/api-key-expiring-soon_html.tmpl +++ b/backend/resources/email-templates/api-key-expiring-soon_html.tmpl @@ -1,3 +1,3 @@ -{{define "root"}}
-{{.AppName}}

{{.AppName}}

API Key Expiring Soon

+{{define "root"}}
+{{.AppName}}

{{.AppName}}

API Key Expiring Soon

Warning

Hello {{.Data.Name}},
This is a reminder that your API key {{.Data.APIKeyName}} will expire on {{.Data.ExpiresAt.Format "2006-01-02 15:04:05 MST"}}.

Please generate a new API key if you need continued access.

{{end}} \ No newline at end of file diff --git a/backend/resources/email-templates/login-with-new-device_html.tmpl b/backend/resources/email-templates/login-with-new-device_html.tmpl index cd612f72..85d2e4dc 100644 --- a/backend/resources/email-templates/login-with-new-device_html.tmpl +++ b/backend/resources/email-templates/login-with-new-device_html.tmpl @@ -1,5 +1,5 @@ -{{define "root"}}
-{{.AppName}}

{{.AppName}}

New Sign-In Detected

+{{define "root"}}
+{{.AppName}}

{{.AppName}}

New Sign-In Detected

Warning

Your {{.AppName}} account was recently accessed from a new IP address or browser. If you recognize this activity, no further action is required.

Details

Approximate Location

-

{{.Data.City}}, {{.Data.Country}}

IP Address

{{.Data.IPAddress}}

Device

-{{.Data.Device}}

Sign-In Time

{{.Data.DateTime.Format "January 2, 2006 at 3:04 PM MST"}}

{{end}} \ No newline at end of file +

{{if and .Data.City .Data.Country}}{{.Data.City}}, {{.Data.Country}}{{else if .Data.Country}}{{.Data.Country}}{{else}}Unknown{{end}}

IP Address

{{.Data.IPAddress}}

Device

+

{{.Data.Device}}

Sign-In Time

{{.Data.DateTime.Format "January 2, 2006 at 3:04 PM MST"}}

{{end}} \ No newline at end of file diff --git a/backend/resources/email-templates/login-with-new-device_text.tmpl b/backend/resources/email-templates/login-with-new-device_text.tmpl index 24940253..b4baba0b 100644 --- a/backend/resources/email-templates/login-with-new-device_text.tmpl +++ b/backend/resources/email-templates/login-with-new-device_text.tmpl @@ -12,7 +12,8 @@ DETAILS Approximate Location -{{.Data.City}}, {{.Data.Country}} +{{if and .Data.City .Data.Country}}{{.Data.City}}, {{.Data.Country}}{{else if +.Data.Country}}{{.Data.Country}}{{else}}Unknown{{end}} IP Address diff --git a/backend/resources/email-templates/one-time-access_html.tmpl b/backend/resources/email-templates/one-time-access_html.tmpl index 2d740500..ba0ae8c4 100644 --- a/backend/resources/email-templates/one-time-access_html.tmpl +++ b/backend/resources/email-templates/one-time-access_html.tmpl @@ -1,4 +1,4 @@ -{{define "root"}}
-{{.AppName}}

{{.AppName}}

Your Login Code

-Click the button below to sign in to {{.AppName}} with a login code.
Or visit {{.Data.LoginLink}} and enter the code {{.Data.Code}}.

This code expires in {{.Data.ExpirationString}}.

{{end}} \ No newline at end of file +{{define "root"}}
+{{.AppName}}

{{.AppName}}

Your Login Code

Click the button below to sign in to +{{.AppName}} with a login code.
Or visit {{.Data.LoginLink}} and enter the code {{.Data.Code}}.

This code expires in {{.Data.ExpirationString}}.

{{end}} \ No newline at end of file diff --git a/backend/resources/email-templates/test_html.tmpl b/backend/resources/email-templates/test_html.tmpl index a7e4c9c5..34a720d0 100644 --- a/backend/resources/email-templates/test_html.tmpl +++ b/backend/resources/email-templates/test_html.tmpl @@ -1,3 +1,3 @@ -{{define "root"}}
-{{.AppName}}

{{.AppName}}

Test Email

-Your email setup is working correctly!

{{end}} \ No newline at end of file +{{define "root"}} +
+{{.AppName}}

{{.AppName}}

Test Email

Your email setup is working correctly!

{{end}} \ No newline at end of file diff --git a/email-templates/components/base-template.tsx b/email-templates/components/base-template.tsx index c8b00fc4..cb7ea17c 100644 --- a/email-templates/components/base-template.tsx +++ b/email-templates/components/base-template.tsx @@ -32,25 +32,24 @@ export const BaseTemplate = ({
- - {appName} - - - {appName} - - + align="left" + style={{ + marginBottom: "16px", + }} + > + + {appName} + + + {appName} + +
{children}
@@ -69,7 +68,6 @@ const logoStyle = { width: "32px", height: "32px", verticalAlign: "middle", - marginRight: "8px", }; const titleStyle = { diff --git a/email-templates/emails/login-with-new-device.tsx b/email-templates/emails/login-with-new-device.tsx index 9f2dc4ec..fbf008da 100644 --- a/email-templates/emails/login-with-new-device.tsx +++ b/email-templates/emails/login-with-new-device.tsx @@ -4,8 +4,7 @@ import CardHeader from "../components/card-header"; import { sharedPreviewProps, sharedTemplateProps } from "../props"; interface SignInData { - city?: string; - country?: string; + location: string; ipAddress: string; device: string; dateTime: string; @@ -42,9 +41,7 @@ export const NewSignInEmail = ({ Approximate Location - - {data.city}, {data.country} - + {data.location} IP Address @@ -84,8 +81,7 @@ const detailsBoxValueStyle = { NewSignInEmail.TemplateProps = { ...sharedTemplateProps, data: { - city: "{{.Data.City}}", - country: "{{.Data.Country}}", + location: "{{if and .Data.City .Data.Country}}{{.Data.City}}, {{.Data.Country}}{{else if .Data.Country}}{{.Data.Country}}{{else}}Unknown{{end}}", ipAddress: "{{.Data.IPAddress}}", device: "{{.Data.Device}}", dateTime: '{{.Data.DateTime.Format "January 2, 2006 at 3:04 PM MST"}}', @@ -95,8 +91,7 @@ NewSignInEmail.TemplateProps = { NewSignInEmail.PreviewProps = { ...sharedPreviewProps, data: { - city: "San Francisco", - country: "USA", + location: "San Francisco, USA", ipAddress: "127.0.0.1", device: "Chrome on macOS", dateTime: "2024-01-01 12:00 PM UTC",