Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ jspm_packages

# build output of `jsx-email`
/.rendered
.cursor
18 changes: 14 additions & 4 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { Preview } from '@storybook/react-vite'
import React from 'react'
import '@helpwave/hightide/style/globals.css'
import '../src/index.css'
import { ThemeProvider, LocaleProvider } from '@helpwave/hightide'

if (typeof window !== 'undefined' && typeof process === 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).process = { env: {} }
if (typeof window !== 'undefined' && typeof (globalThis as { process?: { env: Record<string, string> } }).process === 'undefined') {
(globalThis as { process: { env: Record<string, string> } }).process = { env: {} }
}

const hideLanguageSwitcherCss = `
Expand Down Expand Up @@ -42,7 +44,15 @@ const preview: Preview = {
document.head.appendChild(style)
}
}
return Story()
return React.createElement(
ThemeProvider,
{},
React.createElement(
LocaleProvider,
{ locale: 'en-US' },
React.createElement(Story)
)
)
}
]
}
Expand Down
9 changes: 9 additions & 0 deletions email/html/email-update-confirmation.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("emailUpdateConfirmationTitle")}</h1>
<p>${msg("emailUpdateConfirmationBody1", realm.displayName, newEmail)}</p>
<p>
<a href="${link}" class="button">${msg("doClickHere")}</a>
</p>
<p>${msg("emailUpdateConfirmationBody2")}</p>
</@layout.main>
7 changes: 7 additions & 0 deletions email/html/email-verification-with-code.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("emailVerificationTitle")}</h1>
<p>${msg("emailVerificationBody1", realm.displayName)}</p>
<p><strong>${msg("emailVerificationCode")}: ${code}</strong></p>
<p>${msg("emailVerificationBody2")}</p>
</@layout.main>
10 changes: 10 additions & 0 deletions email/html/email-verification.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("emailVerificationTitle")}</h1>
<p>${msg("emailVerificationBody1", realm.displayName)}</p>
<p>
<a href="${link}" class="button">${msg("doClickHere")}</a>
</p>
<p>${msg("emailVerificationBody2")}</p>
<p>${msg("emailVerificationBody3")}</p>
</@layout.main>
9 changes: 9 additions & 0 deletions email/html/event-login_error.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("eventLoginErrorTitle")}</h1>
<p>${msg("eventLoginErrorBody1", realm.displayName)}</p>
<p class="text-error">${msg("eventLoginErrorBody2")}</p>
<#if ipAddress??>
<p>${msg("eventLoginErrorBody3", ipAddress)}</p>
</#if>
</@layout.main>
9 changes: 9 additions & 0 deletions email/html/event-update_password.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("eventUpdatePasswordTitle")}</h1>
<p>${msg("eventUpdatePasswordBody1", realm.displayName)}</p>
<p>${msg("eventUpdatePasswordBody2")}</p>
<#if ipAddress??>
<p>${msg("eventUpdatePasswordBody3", ipAddress)}</p>
</#if>
</@layout.main>
16 changes: 16 additions & 0 deletions email/html/executeActions.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("executeActionsTitle")}</h1>
<p>${msg("executeActionsBody1", realm.displayName)}</p>
<#if requiredActions??>
<ul>
<#list requiredActions as action>
<li>${msg("requiredAction.${action}")}</li>
</#list>
</ul>
</#if>
<p>
<a href="${link}" class="button">${msg("doClickHere")}</a>
</p>
<p>${msg("executeActionsBody2")}</p>
</@layout.main>
9 changes: 9 additions & 0 deletions email/html/identity-provider-link.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("identityProviderLinkTitle")}</h1>
<p>${msg("identityProviderLinkBody1", realm.displayName, identityProviderAlias)}</p>
<p>
<a href="${link}" class="button">${msg("doClickHere")}</a>
</p>
<p>${msg("identityProviderLinkBody2")}</p>
</@layout.main>
9 changes: 9 additions & 0 deletions email/html/org-invite.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("orgInviteTitle")}</h1>
<p>${msg("orgInviteBody1", realm.displayName, orgName)}</p>
<p>
<a href="${link}" class="button">${msg("doClickHere")}</a>
</p>
<p>${msg("orgInviteBody2")}</p>
</@layout.main>
10 changes: 10 additions & 0 deletions email/html/password-reset.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<#import "template.ftl" as layout>
<@layout.main>
<h1>${msg("emailResetPasswordTitle")}</h1>
<p>${msg("emailResetPasswordBody1", realm.displayName)}</p>
<p>
<a href="${link}" class="button">${msg("doClickHere")}</a>
</p>
<p>${msg("emailResetPasswordBody2")}</p>
<p>${msg("emailResetPasswordBody3")}</p>
</@layout.main>
178 changes: 178 additions & 0 deletions email/html/template.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<!doctype html>
<html lang="${locale.currentLanguageTag}">
<head>
<title>${msg("emailTitle")}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<base target="_blank">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Space+Grotesk:wght@500;700&display=swap" rel="stylesheet">

<style>
body {
background-color: #F0F1F3;
font-family: 'Inter', Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 26px;
margin: 0;
color: #444;
}

h1, h2, h3, h4, h5, h6 {
font-family: 'Space Grotesk', 'Helvetica Neue', Helvetica, sans-serif;
color: #111;
font-weight: 700;
margin-top: 0;
}

pre {
background: #f4f4f4;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}

table {
width: 100%;
border: 1px solid #ddd;
border-collapse: collapse;
}
table td {
border: 1px solid #ddd;
padding: 8px;
}

.wrap {
background-color: #fff;
padding: 40px;
max-width: 525px;
margin: 0 auto;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.brand-header {
text-align: center;
margin-bottom: 30px;
}
.brand-header img {
width: 96px;
height: 96px;
}
.brand-logo-text {
font-family: 'Space Grotesk', sans-serif;
font-weight: 700;
font-size: 24px;
color: #694BB4;
text-decoration: none;
letter-spacing: -0.5px;
}

.button {
background: #694BB4;
border-radius: 6px;
text-decoration: none !important;
color: #fff !important;
font-family: 'Space Grotesk', sans-serif;
font-weight: 700;
padding: 12px 30px;
display: inline-block;
margin: 10px 0;
transition: background 0.3s ease;
}
.button:hover {
background: #533991;
}

.text-success { color: #69D384; font-weight: bold; }
.text-error { color: #D77585; font-weight: bold; }

.footer {
text-align: center;
font-size: 13px;
color: #888;
margin-top: 20px;
font-family: 'Inter', sans-serif;
}
.footer a {
color: #888;
text-decoration: underline;
margin: 0 5px;
}
.footer-links {
margin-bottom: 15px;
}
.footer-links a {
color: #694BB4;
text-decoration: none;
font-weight: 600;
font-family: 'Space Grotesk', sans-serif;
}

.gutter {
padding: 30px;
}

img {
max-width: 100%;
height: auto;
border-radius: 4px;
}

a {
color: #694BB4;
text-decoration: none;
font-weight: 500;
}
a:hover {
text-decoration: underline;
}

@media screen and (max-width: 600px) {
.wrap {
max-width: auto;
padding: 20px;
border-radius: 0;
}
.gutter {
padding: 10px;
}
}
</style>
</head>
<body style="background-color: #F0F1F3; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 26px; margin: 0; color: #444;">

<div class="gutter">&nbsp;</div>

<div class="wrap">
<div class="brand-header">
<img src="https://cdn.helpwave.de/logo/logo.png" alt="helpwave logo" />
<br>
<a href="https://helpwave.de" class="brand-logo-text">helpwave</a>
</div>

<#nested>
</div>

<div class="footer">
<div class="footer-links">
<a href="https://helpwave.de">${msg("website")}</a> •
<a href="https://status.helpwave.de">${msg("status")}</a> •
<a href="mailto:contact@helpwave.de">${msg("support")}</a>
</div>

<p style="margin-bottom: 10px;">
${msg("imprint")}: helpwave GmbH • Jülicher Straße 209q-s • 52070 Aachen • HRB 27480 Aachen
</p>
<p>
<a href="${unsubscribeUrl}">${msg("unsubscribe")}</a>
&nbsp;|&nbsp;
<a href="${messageUrl}">${msg("viewInBrowser")}</a>
</p>
</div>

<div class="gutter">${trackView}</div>
</body>
</html>
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
</head>

<body>
Expand Down
Loading