⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
feat(email): redesign emails with Kaneo components
Andrejed0ea78838ba
diff --git a/.env.sample b/.env.sampleindex 593b379bb..c85399266 100644--- a/.env.sample+++ b/.env.sample@@ -61,6 +61,8 @@ SMTP_USER=SMTP_PASSWORD=SMTP_FROM=SMTP_REQUIRE_TLS=+# Optional public base URL for email images. Defaults to KANEO_CLIENT_URL/email.+#KANEO_EMAIL_ASSETS_URL=# When SMTP is configured, sign-in uses email verification codes by default.# Set to true to use email/password sign-in instead (invitations still use SMTP).#DISABLE_EMAIL_OTP_SIGN_IN=falsediff --git a/apps/api/src/auth.ts b/apps/api/src/auth.tsindex aa588f905..108b82964 100644--- a/apps/api/src/auth.ts+++ b/apps/api/src/auth.ts@@ -66,9 +66,13 @@ import { checkWorkspaceName } from "./utils/check-workspace-name";import { mapCustomOAuthProfileToUser } from "./utils/custom-oauth-profile";import { resolveFileSecret } from "./utils/file-secret";import { generateDemoName } from "./utils/generate-demo-name";+import { getEmailRequestContext } from "./utils/email-request-context";import { getDefaultCookieAttributes } from "./utils/get-default-cookie-attributes";import { getInvitationEmailSubject } from "./utils/get-invitation-email-subject";-import { getWorkspaceInvitationEmailCopy } from "./utils/get-workspace-invitation-email-copy";+import {+ getInvitationRoleLabel,+ getWorkspaceInvitationEmailCopy,+} from "./utils/get-workspace-invitation-email-copy";import { getGithubSsoOAuthCredentials } from "./utils/github-sso-env";import {hasInstanceAdminRole,@@ -174,7 +178,7 @@ function getAuthEmailCopy(locale?: string | null) {if (localeKey === "de") {return {magicLinkSubject: "Anmeldelink für Kaneo",- otpSubject: "Bestätigungscode für Kaneo",+ otpSubject: (otp: string) => `${otp} ist dein Kaneo-Anmeldecode`,passwordResetSubject: "Kaneo-Passwort zurücksetzen",};}@@ -182,7 +186,7 @@ function getAuthEmailCopy(locale?: string | null) {if (localeKey === "vi") {return {magicLinkSubject: "Liên kết đăng nhập Kaneo",- otpSubject: "Mã xác minh Kaneo",+ otpSubject: (otp: string) => `${otp} là mã đăng nhập Kaneo của bạn`,passwordResetSubject: "Đặt lại mật khẩu Kaneo",};}@@ -190,7 +194,7 @@ function getAuthEmailCopy(locale?: string | null) {if (localeKey === "ja") {return {magicLinkSubject: "Kaneo ログインリンク",- otpSubject: "Kaneo 認証コード",+ otpSubject: (otp: string) => `Kaneo のサインインコード: ${otp}`,passwordResetSubject: "Kaneo のパスワードをリセット",};}@@ -198,14 +202,14 @@ function getAuthEmailCopy(locale?: string | null) {if (localeKey === "zh-tw") {return {magicLinkSubject: "Kaneo 登入連結",- otpSubject: "Kaneo 驗證碼",+ otpSubject: (otp: string) => `你的 Kaneo 登入驗證碼:${otp}`,passwordResetSubject: "重設 Kaneo 密碼",};}return {magicLinkSubject: "Login for Kaneo",- otpSubject: "Authentication code for Kaneo",+ otpSubject: (otp: string) => `${otp} is your Kaneo sign-in code`,passwordResetSubject: "Reset your Kaneo password",};}@@ -286,14 +290,20 @@ export const auth = betterAuth({autoSignIn: true,revokeSessionsOnPasswordReset: true,resetPasswordTokenExpiresIn: 60 * 60,- sendResetPassword: async ({ user, url }) => {+ sendResetPassword: async ({ user, url }, request) => {+ const requestContext = getEmailRequestContext(request?.headers);// Keep SMTP latency out of the response so it cannot reveal accounts.trackPasswordResetDelivery(getUserLocale(user.email).then((locale) =>sendPasswordResetEmail(user.email,getAuthEmailCopy(locale).passwordResetSubject,- { resetLink: url, userName: user.name, locale },+ {+ resetLink: url,+ userName: user.name,+ locale,+ ...requestContext,+ },),),);@@ -334,7 +344,10 @@ export const auth = betterAuth({lastLoginMethod(),magicLink({disableSignUp: isPasswordRegistrationDisabled,- sendMagicLink: async ({ email, url }) => {+ sendMagicLink: async ({ email, url }, ctx) => {+ const requestContext = getEmailRequestContext(+ ctx?.request?.headers ?? ctx?.headers,+ );queueSignInEmail(async () => {if (!(await shouldDeliverSignInEmail(email))) {return;@@ -344,6 +357,7 @@ export const auth = betterAuth({await sendMagicLinkEmail(email, copy.magicLinkSubject, {magicLink: url,locale,+ ...requestContext,});});},@@ -354,17 +368,21 @@ export const auth = betterAuth({emailOTP({expiresIn: OTP_EXPIRY_SECONDS,disableSignUp: isPasswordRegistrationDisabled,- async sendVerificationOTP({ email, otp, type }) {+ async sendVerificationOTP({ email, otp, type }, ctx) {if (type === "sign-in") {+ const requestContext = getEmailRequestContext(+ ctx?.request?.headers ?? ctx?.headers,+ );queueSignInEmail(async () => {if (!(await shouldDeliverSignInEmail(email))) {return;}const locale = await getUserLocale(email);const copy = getAuthEmailCopy(locale);- await sendOtpEmail(email, copy.otpSubject, {+ await sendOtpEmail(email, copy.otpSubject(otp), {otp,locale,+ ...requestContext,});});}@@ -619,6 +637,9 @@ export const auth = betterAuth({workspaceName: data.organization.name,invitationLink: inviteLink,to: data.email,+ locale,+ role: getInvitationRoleLabel(locale, data.role),+ expiresAt: data.invitation.expiresAt,copy,},);diff --git a/apps/api/src/notification-preferences/delivery.ts b/apps/api/src/notification-preferences/delivery.tsindex 89f3d7502..048d1f068 100644--- a/apps/api/src/notification-preferences/delivery.ts+++ b/apps/api/src/notification-preferences/delivery.ts@@ -16,6 +16,7 @@ import {safeOutboundError,sendOutboundRequest,} from "../utils/outbound-request";+import { resolveEmailTask } from "./resolve-email-task";import { decryptSecret } from "./secrets";type ResolvedNotificationContext = {@@ -33,9 +34,12 @@ type DeliveryContent = {body: string;};+function getClientUrl() {+ return process.env.KANEO_CLIENT_URL || "http://localhost:5173";+}+function buildTaskUrl(workspaceId: string, projectId: string, taskId: string) {- const clientUrl = process.env.KANEO_CLIENT_URL || "http://localhost:5173";- return `${clientUrl}/dashboard/workspace/${workspaceId}/project/${projectId}/task/${taskId}`;+ return `${getClientUrl()}/dashboard/workspace/${workspaceId}/project/${projectId}/task/${taskId}`;}function getStringValue(@@ -476,14 +480,24 @@ export async function deliverNotification(const deliveries: Array<Promise<void>> = [];if (decryptedPreference.emailEnabled && rule.emailEnabled && user.email) {+ const recipient = user.email;deliveries.push(- sendNotificationEmail(user.email, content.title, {- title: content.title,- message: content.body,- actionUrl: context.taskUrl,- actionLabel: context.taskUrl ? "Open in Kaneo" : undefined,- locale: user.locale ?? null,- }).then(() => undefined),+ (async () => {+ const task = context.taskId+ ? await resolveEmailTask(context.taskId)+ : undefined;+ await sendNotificationEmail(recipient, content.title, {+ title: content.title,+ message: content.body,+ actionUrl: context.taskUrl,+ locale: user.locale ?? null,+ breadcrumb: context.projectName+ ? `${context.workspaceName} / ${context.projectName}`+ : context.workspaceName,+ task,+ settingsUrl: `${getClientUrl()}/dashboard/settings/account/notifications`,+ });+ })(),);}diff --git a/apps/api/src/notification-preferences/email-task-format.test.ts b/apps/api/src/notification-preferences/email-task-format.test.tsnew file mode 100644index 000000000..67550f916--- /dev/null+++ b/apps/api/src/notification-preferences/email-task-format.test.ts@@ -0,0 +1,56 @@+import { describe, expect, it } from "vite-plus/test";+import {+ getInitials,+ resolveColumnIcon,+ resolveDueStatus,+ resolveLabelColor,+ resolvePriority,+} from "./email-task-format";++describe("email task format", () => {+ it("maps label color names and keeps hex values", () => {+ expect(resolveLabelColor("purple")).toBe("#8E51FF");+ expect(resolveLabelColor("#123abc")).toBe("#123abc");+ expect(resolveLabelColor("var(--x)")).toBe("#A1A1A1");+ });++ it("uses the column icon, then the default for its slug", () => {+ expect(+ resolveColumnIcon({ slug: "x", icon: "CircleDot", isFinal: false }),+ ).toBe("circle-dot");+ expect(+ resolveColumnIcon({ slug: "in-review", icon: null, isFinal: false }),+ ).toBe("search");+ expect(+ resolveColumnIcon({ slug: "custom", icon: "Rocket", isFinal: true }),+ ).toBe("check-circle");+ });++ it("drops tasks without a priority", () => {+ expect(resolvePriority("high")).toBe("high");+ expect(resolvePriority("no-priority")).toBeUndefined();+ expect(resolvePriority(null)).toBeUndefined();+ });++ it("matches the board's due date thresholds", () => {+ const now = new Date("2026-10-11T12:00:00Z");+ expect(resolveDueStatus(new Date("2026-10-10T12:00:00Z"), false, now)).toBe(+ "overdue",+ );+ expect(resolveDueStatus(new Date("2026-10-14T12:00:00Z"), false, now)).toBe(+ "due-soon",+ );+ expect(resolveDueStatus(new Date("2026-10-20T12:00:00Z"), false, now)).toBe(+ "far-future",+ );+ expect(resolveDueStatus(new Date("2026-10-10T12:00:00Z"), true, now)).toBe(+ "far-future",+ );+ });++ it("builds initials like the web app", () => {+ expect(getInitials("Maya Kim")).toBe("MK");+ expect(getInitials("maya")).toBe("MA");+ expect(getInitials(" ")).toBeUndefined();+ });+});diff --git a/apps/api/src/notification-preferences/email-task-format.ts b/apps/api/src/notification-preferences/email-task-format.tsnew file mode 100644index 000000000..6b6e964a2--- /dev/null+++ b/apps/api/src/notification-preferences/email-task-format.ts@@ -0,0 +1,106 @@+import type {+ BoardColumnIcon,+ TaskCardDueStatus,+ TaskCardPriority,+} from "@kaneo/email";++const DAY_MS = 24 * 60 * 60 * 1000;++const labelColors: Record<string, string> = {+ gray: "#79716B",+ "dark-gray": "#62748E",+ purple: "#8E51FF",+ teal: "#009966",+ green: "#00A63E",+ yellow: "#E17100",+ orange: "#F54900",+ pink: "#EC003F",+ red: "#E7000B",+};++const FALLBACK_LABEL_COLOR = "#A1A1A1";+const HEX_COLOR = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;++const columnIcons: Record<string, BoardColumnIcon> = {+ Circle: "circle",+ CircleDot: "circle-dot",+ CircleDashed: "circle-dashed",+ Search: "search",+ CheckCircle2: "check-circle",+ Archive: "archive",+};++const defaultColumnIcons: Record<string, BoardColumnIcon> = {+ "to-do": "circle",+ "in-progress": "circle-dot",+ "in-review": "search",+ done: "check-circle",+ archived: "archive",+ planned: "circle-dashed",+};++const priorities = new Set<TaskCardPriority>([+ "urgent",+ "high",+ "medium",+ "low",+]);++export function resolveLabelColor(value: string): string {+ return (+ labelColors[value] ?? (HEX_COLOR.test(value) ? value : FALLBACK_LABEL_COLOR)+ );+}++export function resolveColumnIcon(column: {+ slug: string;+ icon: string | null;+ isFinal: boolean;+}): BoardColumnIcon {+ if (column.icon) {+ return (+ columnIcons[column.icon] ?? (column.isFinal ? "check-circle" : "circle")+ );+ }+ return (+ defaultColumnIcons[column.slug] ??+ (column.isFinal ? "check-circle" : "circle")+ );+}++export function resolvePriority(+ priority: string | null,+): TaskCardPriority | undefined {+ return priorities.has(priority as TaskCardPriority)+ ? (priority as TaskCardPriority)+ : undefined;+}++export function resolveDueStatus(+ dueDate: Date,+ isCompleted: boolean,+ now = new Date(),+): TaskCardDueStatus {+ if (isCompleted) return "far-future";++ const days = Math.ceil((dueDate.getTime() - now.getTime()) / DAY_MS);+ if (days < 0) return "overdue";+ if (days <= 3) return "due-soon";+ return "far-future";+}++export function getInitials(value: string | null | undefined) {+ const parts = value?.trim().split(/\s+/).filter(Boolean) ?? [];++ if (parts.length === 0) return undefined;+ if (parts.length === 1) {+ return Array.from(parts[0]?.toUpperCase() ?? "")+ .slice(0, 2)+ .join("");+ }++ return parts+ .slice(0, 2)+ .map((part) => Array.from(part.toUpperCase())[0])+ .join("");+}diff --git a/apps/api/src/notification-preferences/resolve-email-task.ts b/apps/api/src/notification-preferences/resolve-email-task.tsnew file mode 100644index 000000000..a4221e0ab--- /dev/null+++ b/apps/api/src/notification-preferences/resolve-email-task.ts@@ -0,0 +1,118 @@+import type { NotificationEmailTask } from "@kaneo/email";+import { and, asc, count, eq, isNull } from "drizzle-orm";+import db from "../database";+import {+ columnTable,+ labelTable,+ projectTable,+ taskTable,+ userTable,+} from "../database/schema";+import {+ getInitials,+ resolveColumnIcon,+ resolveDueStatus,+ resolveLabelColor,+ resolvePriority,+} from "./email-task-format";++async function findColumn(task: {+ columnId: string | null;+ projectId: string;+ status: string;+}) {+ const [column] = await db+ .select({+ id: columnTable.id,+ name: columnTable.name,+ slug: columnTable.slug,+ icon: columnTable.icon,+ isFinal: columnTable.isFinal,+ })+ .from(columnTable)+ .where(+ task.columnId+ ? eq(columnTable.id, task.columnId)+ : and(+ eq(columnTable.projectId, task.projectId),+ eq(columnTable.slug, task.status),+ ),+ )+ .limit(1);++ return column;+}++export async function resolveEmailTask(+ taskId: string,+): Promise<NotificationEmailTask | undefined> {+ const [task] = await db+ .select({+ number: taskTable.number,+ title: taskTable.title,+ priority: taskTable.priority,+ dueDate: taskTable.dueDate,+ status: taskTable.status,+ columnId: taskTable.columnId,+ projectId: taskTable.projectId,+ projectSlug: projectTable.slug,+ assigneeName: userTable.name,+ })+ .from(taskTable)+ .innerJoin(projectTable, eq(taskTable.projectId, projectTable.id))+ .leftJoin(userTable, eq(taskTable.userId, userTable.id))+ .where(eq(taskTable.id, taskId))+ .limit(1);++ if (!task) {+ return undefined;+ }++ const [column, labels] = await Promise.all([+ findColumn(task),+ db+ .select({ name: labelTable.name, color: labelTable.color })+ .from(labelTable)+ .where(+ and(+ eq(labelTable.taskId, taskId),+ isNull(labelTable.deletionStartedAt),+ ),+ )+ .orderBy(asc(labelTable.createdAt)),+ ]);++ const [columnCount] = column+ ? await db+ .select({ value: count() })+ .from(taskTable)+ .where(+ and(+ eq(taskTable.projectId, task.projectId),+ eq(taskTable.status, column.slug),+ ),+ )+ : [];++ return {+ ticket: `${task.projectSlug}-${task.number}`,+ title: task.title,+ labels: labels.map((label) => ({+ name: label.name,+ color: resolveLabelColor(label.color),+ })),+ priority: resolvePriority(task.priority),+ dueDate: task.dueDate ?? undefined,+ dueStatus: task.dueDate+ ? resolveDueStatus(task.dueDate, column?.isFinal ?? false)+ : undefined,+ assigneeInitials: getInitials(task.assigneeName),+ column: column+ ? {+ name: column.name,+ icon: resolveColumnIcon(column),+ count: columnCount?.value,+ }+ : undefined,+ };+}diff --git a/apps/api/src/scheduler/trial-reminders.ts b/apps/api/src/scheduler/trial-reminders.tsindex 18323d85d..95b66ab47 100644--- a/apps/api/src/scheduler/trial-reminders.ts+++ b/apps/api/src/scheduler/trial-reminders.ts@@ -1,6 +1,6 @@import { isSmtpConfigured, sendTrialReminderEmail } from "@kaneo/email";import { and, asc, eq, gt, isNotNull, isNull, lte } from "drizzle-orm";-import { isBillingEnabled } from "../billing/config";+import { isBillingEnabled, trialDays } from "../billing/config";import db from "../database";import {billingReminderSentTable,@@ -190,6 +190,8 @@ export async function checkTrialReminders(): Promise<{ degraded: boolean }> {workspaceName: row.workspaceName,daysLeft,billingUrl: `${clientUrl()}/dashboard/settings/workspace/billing`,+ trialDays: trialDays(),+ endsAt: row.trialEndsAt,},);sent++;diff --git a/apps/api/src/utils/email-request-context.ts b/apps/api/src/utils/email-request-context.tsnew file mode 100644index 000000000..146acb19e--- /dev/null+++ b/apps/api/src/utils/email-request-context.ts@@ -0,0 +1,15 @@+import { parseUserAgent, type UserAgentDevice } from "./parse-user-agent";++export type EmailRequestContext = {+ requestedAt: Date;+ device?: UserAgentDevice;+};++export function getEmailRequestContext(+ headers: Headers | null | undefined,+): EmailRequestContext {+ return {+ requestedAt: new Date(),+ device: parseUserAgent(headers?.get("user-agent")),+ };+}diff --git a/apps/api/src/utils/get-workspace-invitation-email-copy.ts b/apps/api/src/utils/get-workspace-invitation-email-copy.tsindex 4e84c4671..a2a7ceaaa 100644--- a/apps/api/src/utils/get-workspace-invitation-email-copy.ts+++ b/apps/api/src/utils/get-workspace-invitation-email-copy.ts@@ -6,25 +6,40 @@ import ptBR from "../../../../i18n/pt-BR.json";import viVN from "../../../../i18n/vi-VN.json";import zhTW from "../../../../i18n/zh-TW.json";-const messages = {- de: deDE.invitations.email,- en: enUS.invitations.email,- fr: frFR.invitations.email,- ja: jaJP.invitations.email,- pt: ptBR.invitations.email,- vi: viVN.invitations.email,- zhTW: zhTW.invitations.email,+const bundles = {+ de: deDE,+ en: enUS,+ fr: frFR,+ ja: jaJP,+ pt: ptBR,+ vi: viVN,+ zhTW: zhTW,} as const;-export function getWorkspaceInvitationEmailCopy(locale?: string | null) {+function getBundle(locale?: string | null) {const normalizedLocale = locale?.toLowerCase();- if (normalizedLocale?.startsWith("de")) return messages.de;- if (normalizedLocale?.startsWith("fr")) return messages.fr;- if (normalizedLocale?.startsWith("ja")) return messages.ja;- if (normalizedLocale?.startsWith("pt")) return messages.pt;- if (normalizedLocale?.startsWith("vi")) return messages.vi;- if (normalizedLocale === "zh-tw") return messages.zhTW;+ if (normalizedLocale?.startsWith("de")) return bundles.de;+ if (normalizedLocale?.startsWith("fr")) return bundles.fr;+ if (normalizedLocale?.startsWith("ja")) return bundles.ja;+ if (normalizedLocale?.startsWith("pt")) return bundles.pt;+ if (normalizedLocale?.startsWith("vi")) return bundles.vi;+ if (normalizedLocale === "zh-tw") return bundles.zhTW;++ return bundles.en;+}++export function getWorkspaceInvitationEmailCopy(locale?: string | null) {+ return getBundle(locale).invitations.email;+}++export function getInvitationRoleLabel(locale: string | null, role: string) {+ const labels: Record<string, string> = getBundle(locale).team.roles;- return messages.en;+ return role+ .split(",")+ .map((name) => name.trim())+ .filter(Boolean)+ .map((name) => (Object.hasOwn(labels, name) ? labels[name] : name))+ .join(", ");}diff --git a/apps/api/src/utils/parse-user-agent.test.ts b/apps/api/src/utils/parse-user-agent.test.tsnew file mode 100644index 000000000..355d6d066--- /dev/null+++ b/apps/api/src/utils/parse-user-agent.test.ts@@ -0,0 +1,46 @@+import { describe, expect, it } from "vite-plus/test";+import { parseUserAgent } from "./parse-user-agent";++describe("parseUserAgent", () => {+ it.each([+ [+ "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1",+ { browser: "Safari", os: "iPhone" },+ ],+ [+ "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/129.0 Mobile/15E148 Safari/604.1",+ { browser: "Chrome", os: "iPhone" },+ ],+ [+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36",+ { browser: "Chrome", os: "macOS" },+ ],+ [+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0",+ { browser: "Edge", os: "Windows" },+ ],+ [+ "Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0",+ { browser: "Firefox", os: "Linux" },+ ],+ [+ "Mozilla/5.0 (Linux; Android 15; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Mobile Safari/537.36",+ { browser: "Chrome", os: "Android" },+ ],+ ])("describes %s", (userAgent, expected) => {+ expect(parseUserAgent(userAgent)).toEqual(expected);+ });++ it("keeps the part it recognizes", () => {+ expect(parseUserAgent("curl/8.7.1 (Windows)")).toEqual({+ browser: undefined,+ os: "Windows",+ });+ });++ it("returns nothing for unknown or missing agents", () => {+ expect(parseUserAgent("kaneo-cli/0.1.1")).toBeUndefined();+ expect(parseUserAgent(undefined)).toBeUndefined();+ expect(parseUserAgent("")).toBeUndefined();+ });+});diff --git a/apps/api/src/utils/parse-user-agent.ts b/apps/api/src/utils/parse-user-agent.tsnew file mode 100644index 000000000..db3dc58b3--- /dev/null+++ b/apps/api/src/utils/parse-user-agent.ts@@ -0,0 +1,43 @@+export type UserAgentDevice = {+ browser?: string;+ os?: string;+};++const MAX_USER_AGENT_LENGTH = 512;++const browsers: Array<[RegExp, string]> = [+ [/\bEdg(?:e|A|iOS)?\//, "Edge"],+ [/\bOPR\/|\bOpera\b/, "Opera"],+ [/\bSamsungBrowser\//, "Samsung Internet"],+ [/\bFirefox\/|\bFxiOS\//, "Firefox"],+ [/\bChrome\/|\bCriOS\//, "Chrome"],+ [/\bSafari\//, "Safari"],+];++const systems: Array<[RegExp, string]> = [+ [/\biPhone\b/, "iPhone"],+ [/\biPad\b/, "iPad"],+ [/\bAndroid\b/, "Android"],+ [/\bCrOS\b/, "ChromeOS"],+ [/\bMacintosh\b|\bMac OS X\b/, "macOS"],+ [/\bWindows\b/, "Windows"],+ [/\bLinux\b/, "Linux"],+];++function match(userAgent: string, patterns: Array<[RegExp, string]>) {+ return patterns.find(([pattern]) => pattern.test(userAgent))?.[1];+}++export function parseUserAgent(+ userAgent: string | null | undefined,+): UserAgentDevice | undefined {+ if (!userAgent) return undefined;++ const value = userAgent.slice(0, MAX_USER_AGENT_LENGTH);+ const device = {+ browser: match(value, browsers),+ os: match(value, systems),+ };++ return device.browser || device.os ? device : undefined;+}diff --git a/apps/docs/core/installation/environment-variables.mdx b/apps/docs/core/installation/environment-variables.mdxindex 8c8a4ce66..c06e30c78 100644--- a/apps/docs/core/installation/environment-variables.mdx+++ b/apps/docs/core/installation/environment-variables.mdx@@ -225,6 +225,7 @@ Name | Description || `SMTP_REQUIRE_TLS` | Require STARTTLS when `SMTP_SECURE=false` (default: `true`). Sending fails if the server cannot upgrade. Only use `false` for an intentionally unencrypted local development relay.| `SMTP_IGNORE_TLS` | Removed: `true` is rejected. This option disabled STARTTLS; it never bypassed certificate validation.| `NODE_EXTRA_CA_CERTS` | Path to a trusted CA PEM file for a private SMTP certificate authority. Set before starting the API; certificate expiry and hostname checks remain enabled.+| `KANEO_EMAIL_ASSETS_URL` | Optional base URL for the logo and icons in emails (default: `KANEO_CLIENT_URL` followed by `/email`). Mail clients load these images directly, so set this to a public URL if your instance is only reachable on a private network.When upgrading, remove `SMTP_IGNORE_TLS=true` and verify delivery with the corrected certificate trust configuration before rollout. Fix invalid certificates instead of disabling validation. [Nodemailer documents the difference between STARTTLS and certificate validation](https://nodemailer.com/smtp#tls-options).diff --git a/apps/web/public/email/arrow-up-right-light-dm.png b/apps/web/public/email/arrow-up-right-light-dm.pngnew file mode 100644index 000000000..7919a9bebBinary files /dev/null and b/apps/web/public/email/arrow-up-right-light-dm.png differdiff --git a/apps/web/public/email/arrow-up-right-light.png b/apps/web/public/email/arrow-up-right-light.pngnew file mode 100644index 000000000..ed414cde4Binary files /dev/null and b/apps/web/public/email/arrow-up-right-light.png differdiff --git a/apps/web/public/email/check-circle-light-dm.png b/apps/web/public/email/check-circle-light-dm.pngnew file mode 100644index 000000000..7cb4b2c7aBinary files /dev/null and b/apps/web/public/email/check-circle-light-dm.png differdiff --git a/apps/web/public/email/check-circle-light.png b/apps/web/public/email/check-circle-light.pngnew file mode 100644index 000000000..8f211a622Binary files /dev/null and b/apps/web/public/email/check-circle-light.png differdiff --git a/apps/web/public/email/column-archive-dm.png b/apps/web/public/email/column-archive-dm.pngnew file mode 100644index 000000000..ac19f8de1Binary files /dev/null and b/apps/web/public/email/column-archive-dm.png differdiff --git a/apps/web/public/email/column-archive.png b/apps/web/public/email/column-archive.pngnew file mode 100644index 000000000..fbf8a24dcBinary files /dev/null and b/apps/web/public/email/column-archive.png differdiff --git a/apps/web/public/email/column-check-circle-dm.png b/apps/web/public/email/column-check-circle-dm.pngnew file mode 100644index 000000000..1f2a9f4c0Binary files /dev/null and b/apps/web/public/email/column-check-circle-dm.png differdiff --git a/apps/web/public/email/column-check-circle.png b/apps/web/public/email/column-check-circle.pngnew file mode 100644index 000000000..7791965d4Binary files /dev/null and b/apps/web/public/email/column-check-circle.png differdiff --git a/apps/web/public/email/column-circle-dashed-dm.png b/apps/web/public/email/column-circle-dashed-dm.pngnew file mode 100644index 000000000..d8031ef2bBinary files /dev/null and b/apps/web/public/email/column-circle-dashed-dm.png differdiff --git a/apps/web/public/email/column-circle-dashed.png b/apps/web/public/email/column-circle-dashed.pngnew file mode 100644index 000000000..5b94d82e5Binary files /dev/null and b/apps/web/public/email/column-circle-dashed.png differdiff --git a/apps/web/public/email/column-circle-dm.png b/apps/web/public/email/column-circle-dm.pngnew file mode 100644index 000000000..4b03cb45bBinary files /dev/null and b/apps/web/public/email/column-circle-dm.png differdiff --git a/apps/web/public/email/column-circle-dot-dm.png b/apps/web/public/email/column-circle-dot-dm.pngnew file mode 100644index 000000000..416426151Binary files /dev/null and b/apps/web/public/email/column-circle-dot-dm.png differdiff --git a/apps/web/public/email/column-circle-dot.png b/apps/web/public/email/column-circle-dot.pngnew file mode 100644index 000000000..1b8119093Binary files /dev/null and b/apps/web/public/email/column-circle-dot.png differdiff --git a/apps/web/public/email/column-circle.png b/apps/web/public/email/column-circle.pngnew file mode 100644index 000000000..f1159a805Binary files /dev/null and b/apps/web/public/email/column-circle.png differdiff --git a/apps/web/public/email/column-search-dm.png b/apps/web/public/email/column-search-dm.pngnew file mode 100644index 000000000..a544ac4cfBinary files /dev/null and b/apps/web/public/email/column-search-dm.png differdiff --git a/apps/web/public/email/column-search.png b/apps/web/public/email/column-search.pngnew file mode 100644index 000000000..0399c33e0Binary files /dev/null and b/apps/web/public/email/column-search.png differdiff --git a/apps/web/public/email/credit-card-light-dm.png b/apps/web/public/email/credit-card-light-dm.pngnew file mode 100644index 000000000..94f33a02fBinary files /dev/null and b/apps/web/public/email/credit-card-light-dm.png differdiff --git a/apps/web/public/email/credit-card-light.png b/apps/web/public/email/credit-card-light.pngnew file mode 100644index 000000000..223098420Binary files /dev/null and b/apps/web/public/email/credit-card-light.png differdiff --git a/apps/web/public/email/due-far-future-dm.png b/apps/web/public/email/due-far-future-dm.pngnew file mode 100644index 000000000..c770ef8bfBinary files /dev/null and b/apps/web/public/email/due-far-future-dm.png differdiff --git a/apps/web/public/email/due-far-future.png b/apps/web/public/email/due-far-future.pngnew file mode 100644index 000000000..d03e8b359Binary files /dev/null and b/apps/web/public/email/due-far-future.png differdiff --git a/apps/web/public/email/due-overdue-dm.png b/apps/web/public/email/due-overdue-dm.pngnew file mode 100644index 000000000..6f11b9856Binary files /dev/null and b/apps/web/public/email/due-overdue-dm.png differdiff --git a/apps/web/public/email/due-overdue.png b/apps/web/public/email/due-overdue.pngnew file mode 100644index 000000000..bbbb6d0a2Binary files /dev/null and b/apps/web/public/email/due-overdue.png differdiff --git a/apps/web/public/email/due-soon-dm.png b/apps/web/public/email/due-soon-dm.pngnew file mode 100644index 000000000..178cd12ccBinary files /dev/null and b/apps/web/public/email/due-soon-dm.png differdiff --git a/apps/web/public/email/due-soon.png b/apps/web/public/email/due-soon.pngnew file mode 100644index 000000000..44f6b15a9Binary files /dev/null and b/apps/web/public/email/due-soon.png differdiff --git a/apps/web/public/email/key-round-light-dm.png b/apps/web/public/email/key-round-light-dm.pngnew file mode 100644index 000000000..157cc270dBinary files /dev/null and b/apps/web/public/email/key-round-light-dm.png differdiff --git a/apps/web/public/email/key-round-light.png b/apps/web/public/email/key-round-light.pngnew file mode 100644index 000000000..465cf350eBinary files /dev/null and b/apps/web/public/email/key-round-light.png differdiff --git a/apps/web/public/email/log-in-light-dm.png b/apps/web/public/email/log-in-light-dm.pngnew file mode 100644index 000000000..b31538f15Binary files /dev/null and b/apps/web/public/email/log-in-light-dm.png differdiff --git a/apps/web/public/email/log-in-light.png b/apps/web/public/email/log-in-light.pngnew file mode 100644index 000000000..39848c2f5Binary files /dev/null and b/apps/web/public/email/log-in-light.png differdiff --git a/apps/web/public/email/mark.png b/apps/web/public/email/mark.pngnew file mode 100644index 000000000..54dfe085bBinary files /dev/null and b/apps/web/public/email/mark.png differdiff --git a/apps/web/public/email/priority-high-dm.png b/apps/web/public/email/priority-high-dm.pngnew file mode 100644index 000000000..9f70c525eBinary files /dev/null and b/apps/web/public/email/priority-high-dm.png differdiff --git a/apps/web/public/email/priority-high.png b/apps/web/public/email/priority-high.pngnew file mode 100644index 000000000..ff53202fdBinary files /dev/null and b/apps/web/public/email/priority-high.png differdiff --git a/apps/web/public/email/priority-low-dm.png b/apps/web/public/email/priority-low-dm.pngnew file mode 100644index 000000000..35f4f67e5Binary files /dev/null and b/apps/web/public/email/priority-low-dm.png differdiff --git a/apps/web/public/email/priority-low.png b/apps/web/public/email/priority-low.pngnew file mode 100644index 000000000..aa6243769Binary files /dev/null and b/apps/web/public/email/priority-low.png differdiff --git a/apps/web/public/email/priority-medium-dm.png b/apps/web/public/email/priority-medium-dm.pngnew file mode 100644index 000000000..20b8aa1baBinary files /dev/null and b/apps/web/public/email/priority-medium-dm.png differdiff --git a/apps/web/public/email/priority-medium.png b/apps/web/public/email/priority-medium.pngnew file mode 100644index 000000000..552256430Binary files /dev/null and b/apps/web/public/email/priority-medium.png differdiff --git a/apps/web/public/email/priority-urgent-dm.png b/apps/web/public/email/priority-urgent-dm.pngnew file mode 100644index 000000000..dcaf90c25Binary files /dev/null and b/apps/web/public/email/priority-urgent-dm.png differdiff --git a/apps/web/public/email/priority-urgent.png b/apps/web/public/email/priority-urgent.pngnew file mode 100644index 000000000..a7d1a3550Binary files /dev/null and b/apps/web/public/email/priority-urgent.png differdiff --git a/apps/web/public/email/users-dark-dm.png b/apps/web/public/email/users-dark-dm.pngnew file mode 100644index 000000000..758e71456Binary files /dev/null and b/apps/web/public/email/users-dark-dm.png differdiff --git a/apps/web/public/email/users-dark.png b/apps/web/public/email/users-dark.pngnew file mode 100644index 000000000..9861107ceBinary files /dev/null and b/apps/web/public/email/users-dark.png differdiff --git a/i18n/az-AZ.json b/i18n/az-AZ.jsonindex bb8e2c112..d8289cd58 100644--- a/i18n/az-AZ.json+++ b/i18n/az-AZ.json@@ -2845,7 +2845,14 @@"cta": "Dəvəti qəbul et","sameEmail": "Dəvəti bu məktubu aldığınız e-poçt ünvanı ilə qəbul edə bilərsiniz.","ignore": "Bu məktubu gözləmirdinizsə, ona məhəl qoymaya bilərsiniz.",- "footer": "Kaneo iş sahəsi dəvəti"+ "footer": "Kaneo iş sahəsi dəvəti",+ "details": {+ "title": "Dəvət təfərrüatları",+ "sentTo": "Göndərildi",+ "instance": "Server",+ "role": "Rol",+ "expires": "Bitmə vaxtı"+ }},"pageTitle": "Dəvətlər","pendingInvitations": "Gözləyən dəvətlər",diff --git a/i18n/de-DE.json b/i18n/de-DE.jsonindex 384ea011f..2c07231a6 100644--- a/i18n/de-DE.json+++ b/i18n/de-DE.json@@ -2845,7 +2845,14 @@"cta": "Einladung annehmen","sameEmail": "Du kannst die Einladung mit derselben E-Mail-Adresse annehmen, die diese Nachricht erhalten hat.","ignore": "Falls du damit nicht gerechnet hast, kannst du diese E-Mail einfach ignorieren.",- "footer": "Kaneo Workspace-Einladung"+ "footer": "Kaneo Workspace-Einladung",+ "details": {+ "title": "Einladungsdetails",+ "sentTo": "Gesendet an",+ "instance": "Instanz",+ "role": "Rolle",+ "expires": "Läuft ab"+ }},"pageTitle": "Einladungen","pendingInvitations": "Ausstehende Einladungen",diff --git a/i18n/el-GR.json b/i18n/el-GR.jsonindex ba37057b7..e92f905cd 100644--- a/i18n/el-GR.json+++ b/i18n/el-GR.json@@ -2845,7 +2845,14 @@"cta": "Αποδοχή πρόσκλησης","sameEmail": "Μπορείτε να αποδεχτείτε την πρόσκληση με το ίδιο email που έλαβε αυτό το μήνυμα.","ignore": "Αν δεν το περιμένατε, μπορείτε να αγνοήσετε με ασφάλεια αυτό το email.",- "footer": "Πρόσκληση χώρου εργασίας Kaneo"+ "footer": "Πρόσκληση χώρου εργασίας Kaneo",+ "details": {+ "title": "Λεπτομέρειες πρόσκλησης",+ "sentTo": "Στάλθηκε σε",+ "instance": "Διακομιστής",+ "role": "Ρόλος",+ "expires": "Λήγει"+ }},"pageTitle": "Προσκλήσεις","pendingInvitations": "Εκκρεμείς προσκλήσεις",diff --git a/i18n/en-US.json b/i18n/en-US.jsonindex cc43cbba3..a65dc34c2 100644--- a/i18n/en-US.json+++ b/i18n/en-US.json@@ -2845,7 +2845,14 @@"cta": "Accept invitation","sameEmail": "You can accept with the same email that received this message.","ignore": "If this wasn't expected, you can safely ignore this email.",- "footer": "Kaneo workspace invitation"+ "footer": "Kaneo workspace invitation",+ "details": {+ "title": "Invitation details",+ "sentTo": "Sent to",+ "instance": "Instance",+ "role": "Role",+ "expires": "Expires"+ }},"pageTitle": "Invitations","pendingInvitations": "Pending Invitations",diff --git a/i18n/es-ES.json b/i18n/es-ES.jsonindex cd9732207..5ea791d47 100644--- a/i18n/es-ES.json+++ b/i18n/es-ES.json@@ -2861,7 +2861,14 @@"cta": "Aceptar invitación","sameEmail": "Puedes aceptarla con el mismo correo que recibió este mensaje.","ignore": "Si no esperabas este correo, puedes ignorarlo sin problema.",- "footer": "Invitación a un espacio de trabajo de Kaneo"+ "footer": "Invitación a un espacio de trabajo de Kaneo",+ "details": {+ "title": "Detalles de la invitación",+ "sentTo": "Enviada a",+ "instance": "Instancia",+ "role": "Rol",+ "expires": "Expira"+ }},"pageTitle": "Invitaciones","pendingInvitations": "Invitaciones pendientes",diff --git a/i18n/fr-FR.json b/i18n/fr-FR.jsonindex 55ccebd12..1afea8c3e 100644--- a/i18n/fr-FR.json+++ b/i18n/fr-FR.json@@ -2861,7 +2861,14 @@"cta": "Accepter l’invitation","sameEmail": "Vous pouvez accepter l’invitation avec l’adresse e-mail qui a reçu ce message.","ignore": "Si vous ne vous attendiez pas à recevoir ce message, vous pouvez l’ignorer.",- "footer": "Invitation à un espace de travail Kaneo"+ "footer": "Invitation à un espace de travail Kaneo",+ "details": {+ "title": "Détails de l’invitation",+ "sentTo": "Envoyée à",+ "instance": "Instance",+ "role": "Rôle",+ "expires": "Expire"+ }},"pageTitle": "Invitations","pendingInvitations": "Invitations en attente",diff --git a/i18n/hi-IN.json b/i18n/hi-IN.jsonindex c03fe2a48..44ad9986e 100644--- a/i18n/hi-IN.json+++ b/i18n/hi-IN.json@@ -2845,7 +2845,14 @@"cta": "निमंत्रण स्वीकार करें","sameEmail": "आप उसी ईमेल से स्वीकार कर सकते हैं जिस पर यह संदेश मिला।","ignore": "यदि यह अपेक्षित नहीं था, तो आप इस ईमेल को सुरक्षित रूप से अनदेखा कर सकते हैं।",- "footer": "Kaneo वर्कस्पेस निमंत्रण"+ "footer": "Kaneo वर्कस्पेस निमंत्रण",+ "details": {+ "title": "निमंत्रण विवरण",+ "sentTo": "भेजा गया",+ "instance": "इंस्टेंस",+ "role": "भूमिका",+ "expires": "समाप्ति"+ }},"pageTitle": "निमंत्रण","pendingInvitations": "लंबित निमंत्रण",diff --git a/i18n/id-ID.json b/i18n/id-ID.jsonindex 7e5aa551b..83f61ca9e 100644--- a/i18n/id-ID.json+++ b/i18n/id-ID.json@@ -2829,7 +2829,14 @@"cta": "Terima undangan","sameEmail": "Anda dapat menerima undangan menggunakan alamat email yang menerima pesan ini.","ignore": "Jika ini tidak Anda harapkan, Anda dapat mengabaikan email ini dengan aman.",- "footer": "Undangan ruang kerja Kaneo"+ "footer": "Undangan ruang kerja Kaneo",+ "details": {+ "title": "Detail undangan",+ "sentTo": "Dikirim ke",+ "instance": "Instans",+ "role": "Peran",+ "expires": "Kedaluwarsa"+ }},"pageTitle": "Undangan","pendingInvitations": "Undangan Tertunda",diff --git a/i18n/it-IT.json b/i18n/it-IT.jsonindex 86df7139a..3955b81ed 100644--- a/i18n/it-IT.json+++ b/i18n/it-IT.json@@ -2861,7 +2861,14 @@"cta": "Accetta invito","sameEmail": "Puoi accettare con la stessa email che ha ricevuto questo messaggio.","ignore": "Se non era previsto, puoi ignorare questa email.",- "footer": "Invito workspace Kaneo"+ "footer": "Invito workspace Kaneo",+ "details": {+ "title": "Dettagli dell’invito",+ "sentTo": "Inviato a",+ "instance": "Istanza",+ "role": "Ruolo",+ "expires": "Scade"+ }},"pageTitle": "Inviti","pendingInvitations": "Inviti in Sospeso",diff --git a/i18n/ja-JP.json b/i18n/ja-JP.jsonindex 529849683..02bd47355 100644--- a/i18n/ja-JP.json+++ b/i18n/ja-JP.json@@ -2829,7 +2829,14 @@"cta": "招待を承諾","sameEmail": "このメッセージを受信したメールアドレスで承諾できます。","ignore": "心当たりがない場合は、このメールを無視していただいて構いません。",- "footer": "Kaneo ワークスペース招待"+ "footer": "Kaneo ワークスペース招待",+ "details": {+ "title": "招待の詳細",+ "sentTo": "送信先",+ "instance": "インスタンス",+ "role": "ロール",+ "expires": "有効期限"+ }},"pageTitle": "招待","pendingInvitations": "保留中の招待",diff --git a/i18n/ko-KR.json b/i18n/ko-KR.jsonindex d4e22906d..a246a3856 100644--- a/i18n/ko-KR.json+++ b/i18n/ko-KR.json@@ -2829,7 +2829,14 @@"cta": "초대 수락","sameEmail": "이 메시지를 받은 이메일과 동일한 이메일로 수락할 수 있습니다.","ignore": "예상하지 못한 초대라면 이 이메일을 무시하셔도 됩니다.",- "footer": "Kaneo 워크스페이스 초대"+ "footer": "Kaneo 워크스페이스 초대",+ "details": {+ "title": "초대 세부 정보",+ "sentTo": "받는 사람",+ "instance": "인스턴스",+ "role": "역할",+ "expires": "만료"+ }},"pageTitle": "초대","pendingInvitations": "대기 중인 초대",diff --git a/i18n/mk-MK.json b/i18n/mk-MK.jsonindex 6186c7cba..d77bbb60b 100644--- a/i18n/mk-MK.json+++ b/i18n/mk-MK.json@@ -2845,7 +2845,14 @@"cta": "Прифати ја поканата","sameEmail": "Можеш да прифатиш со истата е-пошта на која е примена оваа порака.","ignore": "Ако не го очекуваше ова, слободно игнорирај ја оваа е-порака.",- "footer": "Покана за Kaneo работен простор"+ "footer": "Покана за Kaneo работен простор",+ "details": {+ "title": "Детали за поканата",+ "sentTo": "Испратено до",+ "instance": "Инстанца",+ "role": "Улога",+ "expires": "Истекува"+ }},"pageTitle": "Покани","pendingInvitations": "Покани на чекање",diff --git a/i18n/nl-NL.json b/i18n/nl-NL.jsonindex b1571bd19..d15932f01 100644--- a/i18n/nl-NL.json+++ b/i18n/nl-NL.json@@ -2845,7 +2845,14 @@"cta": "Uitnodiging accepteren","sameEmail": "Je kunt accepteren met hetzelfde e-mailadres waarop dit bericht is ontvangen.","ignore": "Verwachtte je deze e-mail niet, dan kun je deze veilig negeren.",- "footer": "Kaneo werkruimte-uitnodiging"+ "footer": "Kaneo werkruimte-uitnodiging",+ "details": {+ "title": "Uitnodigingsdetails",+ "sentTo": "Verzonden naar",+ "instance": "Instantie",+ "role": "Rol",+ "expires": "Verloopt op"+ }},"pageTitle": "Uitnodigingen","pendingInvitations": "Openstaande uitnodigingen",diff --git a/i18n/pl-PL.json b/i18n/pl-PL.jsonindex 946579644..56cf21e63 100644--- a/i18n/pl-PL.json+++ b/i18n/pl-PL.json@@ -904,7 +904,14 @@"cta": "Zaakceptuj zaproszenie","sameEmail": "Możesz zaakceptować zaproszenie przy użyciu tego samego adresu e-mail, na który wysłano tę wiadomość.","ignore": "Jeśli nie było to oczekiwane, możesz bezpiecznie zignorować tego e-maila.",- "footer": "Zaproszenie do obszaru roboczego Kaneo"+ "footer": "Zaproszenie do obszaru roboczego Kaneo",+ "details": {+ "title": "Szczegóły zaproszenia",+ "sentTo": "Wysłano do",+ "instance": "Instancja",+ "role": "Rola",+ "expires": "Wygasa"+ }},"pageTitle": "Zaproszenia","pendingInvitations": "Oczekujące zaproszenia",diff --git a/i18n/pt-BR.json b/i18n/pt-BR.jsonindex c0f866828..18d01dc43 100644--- a/i18n/pt-BR.json+++ b/i18n/pt-BR.json@@ -2861,7 +2861,14 @@"cta": "Aceitar convite","sameEmail": "Você pode aceitar com o mesmo e-mail que recebeu esta mensagem.","ignore": "Se isso não era esperado, você pode ignorar este e-mail com segurança.",- "footer": "Convite para espaço de trabalho do Kaneo"+ "footer": "Convite para espaço de trabalho do Kaneo",+ "details": {+ "title": "Detalhes do convite",+ "sentTo": "Enviado para",+ "instance": "Instância",+ "role": "Função",+ "expires": "Expira"+ }},"pageTitle": "Convites","pendingInvitations": "Convites pendentes",diff --git a/i18n/ru-RU.json b/i18n/ru-RU.jsonindex d96c89583..e3d77c3e1 100644--- a/i18n/ru-RU.json+++ b/i18n/ru-RU.json@@ -2933,7 +2933,14 @@"cta": "Принять приглашение","sameEmail": "Вы можете принять приглашение с того же адреса электронной почты, на который пришло это письмо.","ignore": "Если вы не ожидали этого письма, просто проигнорируйте его.",- "footer": "Приглашение в рабочую область Kaneo"+ "footer": "Приглашение в рабочую область Kaneo",+ "details": {+ "title": "Сведения о приглашении",+ "sentTo": "Отправлено на",+ "instance": "Экземпляр",+ "role": "Роль",+ "expires": "Истекает"+ }},"pageTitle": "Приглашения","pendingInvitations": "Ожидающие приглашения",diff --git a/i18n/schema.json b/i18n/schema.jsonindex cc828a075..7533a223b 100644--- a/i18n/schema.json+++ b/i18n/schema.json@@ -11713,6 +11713,28 @@},"footer": {"type": "string"+ },+ "details": {+ "type": "object",+ "additionalProperties": false,+ "properties": {+ "title": {+ "type": "string"+ },+ "sentTo": {+ "type": "string"+ },+ "instance": {+ "type": "string"+ },+ "role": {+ "type": "string"+ },+ "expires": {+ "type": "string"+ }+ },+ "required": ["title", "sentTo", "instance", "role", "expires"]}},"required": [@@ -11723,7 +11745,8 @@"cta","sameEmail","ignore",- "footer"+ "footer",+ "details"]},"pageTitle": {diff --git a/i18n/tr-TR.json b/i18n/tr-TR.jsonindex acf0a7a9c..9cf697bc9 100644--- a/i18n/tr-TR.json+++ b/i18n/tr-TR.json@@ -2863,7 +2863,14 @@"cta": "Daveti kabul et","sameEmail": "Daveti, bu mesajı alan e-posta adresiyle kabul edebilirsiniz.","ignore": "Bu davet beklenmedikse bu e-postayı güvenle yok sayabilirsiniz.",- "footer": "Kaneo çalışma alanı daveti"+ "footer": "Kaneo çalışma alanı daveti",+ "details": {+ "title": "Davet ayrıntıları",+ "sentTo": "Gönderilen adres",+ "instance": "Sunucu",+ "role": "Rol",+ "expires": "Süre Sonu"+ }}},"workspace": {diff --git a/i18n/uk-UA.json b/i18n/uk-UA.jsonindex 374ae6e9a..9b53ae7ce 100644--- a/i18n/uk-UA.json+++ b/i18n/uk-UA.json@@ -2877,7 +2877,14 @@"cta": "Прийняти запрошення","sameEmail": "Ви можете прийняти запрошення з тієї самої адреси електронної пошти, на яку надійшов цей лист.","ignore": "Якщо ви не очікували цього листа, просто проігноруйте його.",- "footer": "Запрошення до робочого простору Kaneo"+ "footer": "Запрошення до робочого простору Kaneo",+ "details": {+ "title": "Деталі запрошення",+ "sentTo": "Надіслано на",+ "instance": "Екземпляр",+ "role": "Роль",+ "expires": "Закінчується"+ }},"pageTitle": "Запрошення","pendingInvitations": "Очікуючі запрошення",diff --git a/i18n/vi-VN.json b/i18n/vi-VN.jsonindex 080b03e0b..9eea60db1 100644--- a/i18n/vi-VN.json+++ b/i18n/vi-VN.json@@ -2829,7 +2829,14 @@"cta": "Chấp nhận lời mời","sameEmail": "Bạn có thể chấp nhận bằng email đã nhận thư này.","ignore": "Nếu bạn không mong đợi email này, bạn có thể yên tâm bỏ qua.",- "footer": "Lời mời không gian làm việc Kaneo"+ "footer": "Lời mời không gian làm việc Kaneo",+ "details": {+ "title": "Chi tiết lời mời",+ "sentTo": "Gửi đến",+ "instance": "Máy chủ",+ "role": "Vai trò",+ "expires": "Hết hạn"+ }},"pageTitle": "Lời mời","pendingInvitations": "Lời mời đang chờ",diff --git a/i18n/zh-CN.json b/i18n/zh-CN.jsonindex 694352d00..24440b6da 100644--- a/i18n/zh-CN.json+++ b/i18n/zh-CN.json@@ -2829,7 +2829,14 @@"cta": "接受邀请","sameEmail": "你可以使用收到此邮件的同一邮箱接受。","ignore": "如果这不是你预期的,可以安全忽略此邮件。",- "footer": "Kaneo 工作区邀请"+ "footer": "Kaneo 工作区邀请",+ "details": {+ "title": "邀请详情",+ "sentTo": "发送至",+ "instance": "实例",+ "role": "角色",+ "expires": "过期时间"+ }},"pageTitle": "邀请","pendingInvitations": "待处理的邀请",diff --git a/i18n/zh-TW.json b/i18n/zh-TW.jsonindex c9ae7b5b0..2e5caca29 100644--- a/i18n/zh-TW.json+++ b/i18n/zh-TW.json@@ -2829,7 +2829,14 @@"cta": "接受邀請","sameEmail": "請使用收到這封郵件的同一個電子郵件地址接受邀請。","ignore": "如果你沒有預期收到這封郵件,請直接忽略。",- "footer": "Kaneo 工作區邀請"+ "footer": "Kaneo 工作區邀請",+ "details": {+ "title": "邀請詳細資料",+ "sentTo": "寄送至",+ "instance": "執行個體",+ "role": "角色",+ "expires": "到期時間"+ }},"pageTitle": "邀請","pendingInvitations": "待處理的邀請",diff --git a/packages/email/package.json b/packages/email/package.jsonindex b89982d94..1b19c0eb4 100644--- a/packages/email/package.json+++ b/packages/email/package.json@@ -29,6 +29,7 @@},"devDependencies": {"@react-email/render": "^2.1.0",+ "@react-email/ui": "6.11.0","@types/react": "^19.3.0","@types/react-dom": "^19.3.0","react-email": "6.11.0",diff --git a/packages/email/src/components/assets.ts b/packages/email/src/components/assets.tsnew file mode 100644index 000000000..e2d9f1d32--- /dev/null+++ b/packages/email/src/components/assets.ts@@ -0,0 +1,11 @@+export function emailAsset(name: string): string {+ const explicit = process.env.KANEO_EMAIL_ASSETS_URL;+ const clientUrl = process.env.KANEO_CLIENT_URL;+ const base = explicit+ ? explicit+ : clientUrl+ ? `${clientUrl.replace(/\/$/, "")}/email`+ : "/static";++ return `${base.replace(/\/$/, "")}/${name}.png`;+}diff --git a/packages/email/src/components/badge.tsx b/packages/email/src/components/badge.tsxnew file mode 100644index 000000000..cc3ed05f0--- /dev/null+++ b/packages/email/src/components/badge.tsx@@ -0,0 +1,30 @@+import React from "react";+import { colors } from "./tokens";++void React;++type BadgeProps = {+ children: React.ReactNode;+};++export function Badge({ children }: BadgeProps) {+ return (+ <span className="k-badge" style={badge}>+ {children}+ </span>+ );+}++const badge = {+ display: "inline-block",+ padding: "0 3px",+ borderWidth: "1px",+ borderStyle: "solid",+ borderColor: colors.input,+ borderRadius: "6px",+ backgroundColor: colors.background,+ color: colors.foreground,+ fontSize: "12px",+ lineHeight: "16px",+ fontWeight: "500",+};diff --git a/packages/email/src/components/board-column.tsx b/packages/email/src/components/board-column.tsxnew file mode 100644index 000000000..8ea3b63b4--- /dev/null+++ b/packages/email/src/components/board-column.tsx@@ -0,0 +1,103 @@+import { Section, Text } from "@react-email/components";+import React from "react";+import { ThemedImg } from "./themed-img";+import { colors, shadow } from "./tokens";++void React;++export type BoardColumnIcon =+ | "circle"+ | "circle-dot"+ | "circle-dashed"+ | "search"+ | "check-circle"+ | "archive";++type BoardColumnProps = {+ name: string;+ icon?: BoardColumnIcon;+ count?: number;+ children: React.ReactNode;+};++export function BoardColumn({+ name,+ icon = "circle",+ count,+ children,+}: BoardColumnProps) {+ return (+ <Section align={undefined} width="320" className="k-column" style={column}>+ <Section className="k-divider" style={header}>+ <Text style={headerText}>+ <ThemedImg+ name={`column-${icon}`}+ width={16}+ height={16}+ style={iconStyle}+ />+ <span className="k-text-95" style={nameStyle}>+ {name}+ </span>+ {count !== undefined ? (+ <span className="k-chip k-muted" style={countStyle}>+ {count}+ </span>+ ) : null}+ </Text>+ </Section>+ <Section style={body}>{children}</Section>+ </Section>+ );+}++const column = {+ width: "320px",+ maxWidth: "100%",+ margin: "0",+ borderRadius: "14px",+ borderWidth: "1px",+ borderStyle: "solid",+ borderColor: colors.columnBorder,+ backgroundColor: colors.column,+ boxShadow: shadow,+};++const header = {+ padding: "8px 12px",+ borderWidth: "0 0 1px",+ borderStyle: "solid",+ borderColor: colors.columnHeaderBorder,+};++const headerText = {+ margin: "0",+ fontSize: "14px",+ lineHeight: "20px",+};++const iconStyle = {+ marginRight: "8px",+ verticalAlign: "-3px",+};++const nameStyle = {+ color: colors.foreground95,+ fontWeight: "500",+};++const countStyle = {+ display: "inline-block",+ marginLeft: "8px",+ padding: "2px 6px",+ borderRadius: "8px",+ backgroundColor: colors.muted,+ color: colors.mutedForeground,+ fontSize: "12px",+ lineHeight: "16px",+ fontWeight: "500",+};++const body = {+ padding: "8px",+};diff --git a/packages/email/src/components/detail-rows.tsx b/packages/email/src/components/detail-rows.tsxnew file mode 100644index 000000000..968db29b9--- /dev/null+++ b/packages/email/src/components/detail-rows.tsx@@ -0,0 +1,67 @@+import { Column, Row } from "@react-email/components";+import React from "react";+import { colors } from "./tokens";++void React;++export type DetailRow = {+ label: string;+ value: React.ReactNode;+};++type DetailRowsProps = {+ rows: DetailRow[];+};++export function DetailRows({ rows }: DetailRowsProps) {+ return (+ <>+ {rows.map((row, position) => {+ const divider =+ position < rows.length - 1+ ? {+ borderWidth: "0 0 1px",+ borderStyle: "solid",+ borderColor: colors.border,+ }+ : null;++ return (+ <Row key={row.label}>+ <Column+ className={divider ? "k-muted k-divider" : "k-muted"}+ style={{ ...label, ...divider }}+ >+ {row.label}+ </Column>+ <Column+ align="right"+ className={divider ? "k-text k-divider" : "k-text"}+ style={{ ...value, ...divider }}+ >+ {row.value}+ </Column>+ </Row>+ );+ })}+ </>+ );+}++const cell = {+ padding: "10px 0",+ fontSize: "14px",+ lineHeight: "20px",+};++const label = {+ ...cell,+ color: colors.mutedForeground,+};++const value = {+ ...cell,+ color: colors.foreground,+ fontWeight: "500",+ textAlign: "right" as const,+};diff --git a/packages/email/src/components/email-button.tsx b/packages/email/src/components/email-button.tsxnew file mode 100644index 000000000..f7da425c9--- /dev/null+++ b/packages/email/src/components/email-button.tsx@@ -0,0 +1,67 @@+import { Button } from "@react-email/components";+import React from "react";+import { ThemedImg } from "./themed-img";+import { colors, fontFamily } from "./tokens";++void React;++type EmailButtonProps = {+ href: string;+ icon?: string;+ fullWidth?: boolean;+ children: React.ReactNode;+};++export function EmailButton({+ href,+ icon,+ fullWidth = false,+ children,+}: EmailButtonProps) {+ return (+ <Button+ href={href}+ className="k-btn"+ style={{+ ...base,+ ...primary,+ ...(fullWidth ? block : null),+ }}+ >+ {icon ? (+ <ThemedImg name={icon} width={16} height={16} style={iconStyle} />+ ) : null}+ {children}+ </Button>+ );+}++const base = {+ display: "inline-block",+ padding: "7px 11px",+ borderRadius: "10px",+ fontFamily,+ fontSize: "14px",+ lineHeight: "20px",+ fontWeight: "500",+ textDecoration: "none",+};++const primary = {+ border: `1px solid ${colors.primary}`,+ backgroundColor: colors.primary,+ color: colors.primaryForeground,+ boxShadow:+ "inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(38, 38, 38, 0.24)",+};++const block = {+ display: "block",+ textAlign: "center" as const,+};++const iconStyle = {+ margin: "0 8px 0 0",+ verticalAlign: "-3px",+ opacity: "0.8",+};diff --git a/packages/email/src/components/email-footer.tsx b/packages/email/src/components/email-footer.tsxnew file mode 100644index 000000000..3805136cf--- /dev/null+++ b/packages/email/src/components/email-footer.tsx@@ -0,0 +1,81 @@+import { Link, Section, Text } from "@react-email/components";+import React from "react";+import { colors } from "./tokens";++void React;++export type FooterLink = {+ label: string;+ href: string;+};++type EmailFooterProps = {+ title: string;+ reason?: string;+ links: FooterLink[];+};++export function EmailFooter({ title, reason, links }: EmailFooterProps) {+ return (+ <Section className="k-divider" style={wrapper}>+ <Text className="k-text" style={titleStyle}>+ {title}+ </Text>+ {reason ? (+ <Text className="k-muted" style={reasonStyle}>+ {reason}+ </Text>+ ) : null}+ <Text style={linksStyle}>+ {links.map((link, position) => (+ <React.Fragment key={link.href}>+ {position > 0 ? <span style={spacer}> </span> : null}+ <Link href={link.href} className="k-link" style={linkStyle}>+ {link.label}+ </Link>+ </React.Fragment>+ ))}+ </Text>+ </Section>+ );+}++const wrapper = {+ borderWidth: "1px 0 0",+ borderStyle: "solid",+ borderColor: colors.border,+ paddingTop: "24px",+};++const titleStyle = {+ margin: "0",+ color: colors.foreground,+ fontSize: "12px",+ lineHeight: "18px",+ fontWeight: "500",+};++const reasonStyle = {+ margin: "2px 0 0",+ maxWidth: "460px",+ color: colors.mutedForeground,+ fontSize: "12px",+ lineHeight: "18px",+};++const linksStyle = {+ margin: "8px 0 0",+ fontSize: "12px",+ lineHeight: "18px",+};++const spacer = {+ display: "inline-block",+ width: "16px",+};++const linkStyle = {+ color: colors.foreground,+ fontWeight: "500",+ textDecoration: "underline",+};diff --git a/packages/email/src/components/email-intro.tsx b/packages/email/src/components/email-intro.tsxnew file mode 100644index 000000000..37dda4899--- /dev/null+++ b/packages/email/src/components/email-intro.tsx@@ -0,0 +1,41 @@+import { Heading, Text } from "@react-email/components";+import React from "react";+import { colors } from "./tokens";++void React;++type EmailIntroProps = {+ title: string;+ subtitle?: string;+};++export function EmailIntro({ title, subtitle }: EmailIntroProps) {+ return (+ <>+ <Heading as="h1" className="k-text" style={heading}>+ {title}+ </Heading>+ {subtitle ? (+ <Text className="k-subtle" style={subtitleText}>+ {subtitle}+ </Text>+ ) : null}+ </>+ );+}++const heading = {+ margin: "0 0 10px",+ color: colors.foreground,+ fontSize: "24px",+ lineHeight: "32px",+ fontWeight: "600",+ letterSpacing: "-0.6px",+};++const subtitleText = {+ margin: "0 0 28px",+ color: "#525252",+ fontSize: "14px",+ lineHeight: "22px",+};diff --git a/packages/email/src/components/email-note.tsx b/packages/email/src/components/email-note.tsxnew file mode 100644index 000000000..bd40a27f6--- /dev/null+++ b/packages/email/src/components/email-note.tsx@@ -0,0 +1,45 @@+import { Heading, Section, Text } from "@react-email/components";+import React from "react";+import { colors } from "./tokens";++void React;++type EmailNoteProps = {+ title?: string;+ children: React.ReactNode;+};++export function EmailNote({ title, children }: EmailNoteProps) {+ return (+ <Section style={wrapper}>+ {title ? (+ <Heading as="h2" className="k-text" style={heading}>+ {title}+ </Heading>+ ) : null}+ <Text className="k-subtle" style={body}>+ {children}+ </Text>+ </Section>+ );+}++const wrapper = {+ margin: "32px 0 40px",+};++const heading = {+ margin: "0 0 4px",+ color: colors.foreground,+ fontSize: "14px",+ lineHeight: "22px",+ fontWeight: "500",+};++const body = {+ margin: "0",+ maxWidth: "500px",+ color: "#525252",+ fontSize: "14px",+ lineHeight: "22px",+};diff --git a/packages/email/src/components/email-shell.tsx b/packages/email/src/components/email-shell.tsxnew file mode 100644index 000000000..9316f3ac6--- /dev/null+++ b/packages/email/src/components/email-shell.tsx@@ -0,0 +1,112 @@+import {+ Column,+ Container,+ Head,+ Html,+ Img,+ Preview,+ Row,+} from "@react-email/components";+import React from "react";+import { emailAsset } from "./assets";+import { themeCss } from "./theme";+import { colors, fontFamily } from "./tokens";++void React;++type EmailShellProps = {+ title: string;+ preview: string;+ lang: string;+ children: React.ReactNode;+};++export function EmailShell({+ title,+ preview,+ lang,+ children,+}: EmailShellProps) {+ return (+ <Html lang={lang} dir="ltr">+ <Head>+ <title>{title}</title>+ <meta name="color-scheme" content="light dark" />+ <meta name="supported-color-schemes" content="light dark" />+ <style>{themeCss}</style>+ </Head>+ <Preview>{preview}</Preview>+ <body className="k-bg" style={body}>+ <div+ role="article"+ aria-roledescription="email"+ aria-label={title}+ lang={lang}+ dir="ltr"+ className="k-bg"+ style={page}+ >+ <Container style={container}>+ <Row style={brand}>+ <Column style={markCell}>+ <Img+ src={emailAsset("mark")}+ width="28"+ height="28"+ alt=""+ style={mark}+ />+ </Column>+ <Column className="k-text" style={wordmark}>+ Kaneo+ </Column>+ </Row>+ {children}+ </Container>+ </div>+ </body>+ </Html>+ );+}++const page = {+ backgroundColor: colors.background,+};++const body = {+ margin: "0",+ padding: "0",+ backgroundColor: colors.background,+ color: colors.foreground,+ fontFamily,+};++const container = {+ maxWidth: "600px",+ margin: "0 auto",+ padding: "48px 24px 56px",+};++const brand = {+ marginBottom: "40px",+};++const markCell = {+ width: "38px",+ verticalAlign: "middle" as const,+};++const mark = {+ display: "block",+ border: "0",+ borderRadius: "7px",+};++const wordmark = {+ verticalAlign: "middle" as const,+ color: colors.foreground,+ fontSize: "19px",+ lineHeight: "28px",+ fontWeight: "600",+ letterSpacing: "-0.4px",+};diff --git a/packages/email/src/components/fallback-link.tsx b/packages/email/src/components/fallback-link.tsxnew file mode 100644index 000000000..5641c494b--- /dev/null+++ b/packages/email/src/components/fallback-link.tsx@@ -0,0 +1,46 @@+import { Link, Text } from "@react-email/components";+import React from "react";+import { colors } from "./tokens";++void React;++type FallbackLinkProps = {+ label: string;+ href: string;+};++export function FallbackLink({ label, href }: FallbackLinkProps) {+ return (+ <>+ <Text className="k-muted" style={labelStyle}>+ {label}+ </Text>+ <Text style={linkWrapper}>+ <Link href={href} className="k-link" style={link}>+ {href}+ </Link>+ </Text>+ </>+ );+}++const labelStyle = {+ margin: "16px 0 2px",+ color: colors.mutedForeground,+ fontSize: "12px",+ lineHeight: "18px",+};++const linkWrapper = {+ margin: "0 0 32px",+ fontSize: "12px",+ lineHeight: "18px",+ wordBreak: "break-all" as const,+};++const link = {+ color: colors.foreground,+ fontFamily:+ '"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',+ textDecoration: "underline",+};diff --git a/packages/email/src/components/footer-links.ts b/packages/email/src/components/footer-links.tsnew file mode 100644index 000000000..07fb75e96--- /dev/null+++ b/packages/email/src/components/footer-links.ts@@ -0,0 +1,24 @@+import type { EmailLocale } from "../templates/resolve-locale";+import type { FooterLink } from "./email-footer";++const labels: Record<EmailLocale, { help: string; privacy: string }> = {+ en: { help: "Help", privacy: "Privacy" },+ de: { help: "Hilfe", privacy: "Datenschutz" },+ vi: { help: "Trợ giúp", privacy: "Quyền riêng tư" },+ ja: { help: "ヘルプ", privacy: "プライバシー" },+ "zh-tw": { help: "說明", privacy: "隱私權" },+};++export function footerLinks(+ locale: EmailLocale,+ leading: FooterLink[] = [],+): FooterLink[] {+ const copy = labels[locale];++ return [+ ...leading,+ { label: "kaneo.app", href: "https://kaneo.app" },+ { label: copy.help, href: "https://kaneo.app/docs" },+ { label: copy.privacy, href: "https://kaneo.app/privacy" },+ ];+}diff --git a/packages/email/src/components/format-date.ts b/packages/email/src/components/format-date.tsnew file mode 100644index 000000000..1caea5308--- /dev/null+++ b/packages/email/src/components/format-date.ts@@ -0,0 +1,41 @@+export type DateInput = Date | string;++function toDate(value: DateInput): Date | null {+ const date = value instanceof Date ? value : new Date(value);+ return Number.isNaN(date.getTime()) ? null : date;+}++function format(+ value: DateInput,+ lang: string,+ options: Intl.DateTimeFormatOptions,+): string | undefined {+ const date = toDate(value);+ if (!date) return undefined;+ return new Intl.DateTimeFormat(lang, { ...options, timeZone: "UTC" }).format(+ date,+ );+}++export function formatDateTime(value: DateInput, lang: string) {+ return format(value, lang, {+ year: "numeric",+ month: "short",+ day: "numeric",+ hour: "2-digit",+ minute: "2-digit",+ timeZoneName: "short",+ });+}++export function formatDate(value: DateInput, lang: string) {+ return format(value, lang, {+ year: "numeric",+ month: "short",+ day: "numeric",+ });+}++export function formatShortDate(value: DateInput, lang: string) {+ return format(value, lang, { month: "short", day: "numeric" });+}diff --git a/packages/email/src/components/frame.tsx b/packages/email/src/components/frame.tsxnew file mode 100644index 000000000..2618f3b76--- /dev/null+++ b/packages/email/src/components/frame.tsx@@ -0,0 +1,71 @@+import { Heading, Section, Text } from "@react-email/components";+import React from "react";+import { colors, shadow } from "./tokens";++void React;++type FrameProps = {+ title: string;+ description?: string;+ panelPadding?: string;+ children: React.ReactNode;+};++export function Frame({+ title,+ description,+ panelPadding = "20px",+ children,+}: FrameProps) {+ return (+ <Section className="k-frame" style={frame}>+ <Section style={header}>+ <Heading as="h2" className="k-text" style={titleStyle}>+ {title}+ </Heading>+ {description ? (+ <Text className="k-muted" style={descriptionStyle}>+ {description}+ </Text>+ ) : null}+ </Section>+ <Section className="k-panel" style={{ ...panel, padding: panelPadding }}>+ {children}+ </Section>+ </Section>+ );+}++const frame = {+ borderRadius: "16px",+ backgroundColor: colors.frame,+ padding: "4px",+};++const header = {+ padding: "16px 20px",+};++const titleStyle = {+ margin: "0",+ color: colors.foreground,+ fontSize: "14px",+ lineHeight: "20px",+ fontWeight: "600",+};++const descriptionStyle = {+ margin: "2px 0 0",+ color: colors.mutedForeground,+ fontSize: "14px",+ lineHeight: "20px",+};++const panel = {+ borderRadius: "14px",+ borderWidth: "1px",+ borderStyle: "solid",+ borderColor: colors.border,+ backgroundColor: colors.background,+ boxShadow: shadow,+};diff --git a/packages/email/src/components/instance-host.ts b/packages/email/src/components/instance-host.tsnew file mode 100644index 000000000..0d289e3cc--- /dev/null+++ b/packages/email/src/components/instance-host.ts@@ -0,0 +1,10 @@+export function instanceHost(): string | undefined {+ const clientUrl = process.env.KANEO_CLIENT_URL;+ if (!clientUrl) return undefined;++ try {+ return new URL(clientUrl).host;+ } catch {+ return undefined;+ }+}diff --git a/packages/email/src/components/invitation-card.tsx b/packages/email/src/components/invitation-card.tsxnew file mode 100644index 000000000..0ce15b2f1--- /dev/null+++ b/packages/email/src/components/invitation-card.tsx@@ -0,0 +1,75 @@+import { Heading, Section, Text } from "@react-email/components";+import React from "react";+import { EmailButton } from "./email-button";+import { ThemedImg } from "./themed-img";+import { colors, shadow } from "./tokens";++void React;++type InvitationCardProps = {+ workspaceName: string;+ description: string;+ cta: string;+ href: string;+};++export function InvitationCard({+ workspaceName,+ description,+ cta,+ href,+}: InvitationCardProps) {+ return (+ <Section className="k-card" style={card}>+ <div className="k-icon-circle" style={iconCircle}>+ <ThemedImg name="users-dark" width={24} height={24} style={icon} />+ </div>+ <Heading as="h2" className="k-text" style={name}>+ {workspaceName}+ </Heading>+ <Text className="k-muted" style={descriptionStyle}>+ {description}+ </Text>+ <EmailButton href={href} icon="check-circle-light" fullWidth>+ {cta}+ </EmailButton>+ </Section>+ );+}++const card = {+ borderRadius: "16px",+ borderWidth: "1px",+ borderStyle: "solid",+ borderColor: colors.border,+ backgroundColor: colors.background,+ boxShadow: shadow,+ padding: "24px",+ textAlign: "center" as const,+};++const iconCircle = {+ width: "48px",+ margin: "0 auto 16px",+ borderRadius: "50%",+ backgroundColor: colors.primarySubtle,+};++const icon = {+ padding: "12px",+};++const name = {+ margin: "0 0 12px",+ color: colors.foreground,+ fontSize: "18px",+ lineHeight: "28px",+ fontWeight: "600",+};++const descriptionStyle = {+ margin: "0 0 24px",+ color: colors.mutedForeground,+ fontSize: "14px",+ lineHeight: "20px",+};diff --git a/packages/email/src/components/otp-code.tsx b/packages/email/src/components/otp-code.tsxnew file mode 100644index 000000000..7ab8db0c6--- /dev/null+++ b/packages/email/src/components/otp-code.tsx@@ -0,0 +1,80 @@+import { Column, Row, Section, Text } from "@react-email/components";+import React from "react";+import { colors, shadow } from "./tokens";++void React;++type OtpCodeProps = {+ code: string;+ label: string;+ hint: string;+};++const SLOT_WIDTH = 59;+const SLOT_GAP = 6;++export function OtpCode({ code, label, hint }: OtpCodeProps) {+ const slots = Array.from(code, (digit, slot) => ({ digit, slot }));+ const last = slots.length - 1;++ return (+ <Section style={wrapper}>+ <Text className="k-text" style={labelStyle}>+ {label}+ </Text>+ <Row+ align={undefined}+ width={String(slots.length * (SLOT_WIDTH + SLOT_GAP))}+ >+ {slots.map(({ digit, slot }) => (+ <Column+ key={slot}+ style={{+ width: `${SLOT_WIDTH}px`,+ paddingRight: slot < last ? `${SLOT_GAP}px` : 0,+ }}+ >+ <div className="k-slot" style={slotStyle}>+ {digit}+ </div>+ </Column>+ ))}+ </Row>+ <Text className="k-muted" style={hintStyle}>+ {hint}+ </Text>+ </Section>+ );+}++const wrapper = {+ margin: "0 0 32px",+};++const labelStyle = {+ margin: "0 0 8px",+ color: colors.foreground,+ fontSize: "14px",+ lineHeight: "16px",+ fontWeight: "500",+};++const slotStyle = {+ lineHeight: "42px",+ textAlign: "center" as const,+ borderWidth: "1px",+ borderStyle: "solid",+ borderColor: colors.input,+ borderRadius: "8px",+ backgroundColor: colors.background,+ boxShadow: shadow,+ color: colors.foreground,+ fontSize: "14px",+};++const hintStyle = {+ margin: "8px 0 0",+ color: colors.mutedForeground,+ fontSize: "14px",+ lineHeight: "20px",+};diff --git a/packages/email/src/components/progress.tsx b/packages/email/src/components/progress.tsxnew file mode 100644index 000000000..10ee09c5d--- /dev/null+++ b/packages/email/src/components/progress.tsx@@ -0,0 +1,69 @@+import { Column, Row } from "@react-email/components";+import React from "react";+import { colors } from "./tokens";++void React;++type ProgressProps = {+ label: string;+ value: string;+ percent: number;+};++export function Progress({ label, value, percent }: ProgressProps) {+ const filled = Math.min(100, Math.max(0, Math.round(percent)));++ return (+ <>+ <Row>+ <Column className="k-text" style={labelStyle}>+ {label}+ </Column>+ <Column align="right" className="k-text" style={valueStyle}>+ {value}+ </Column>+ </Row>+ <Row className="k-track" style={track}>+ {filled > 0 ? (+ <Column className="k-bar" style={{ ...bar, width: `${filled}%` }}>+ + </Column>+ ) : null}+ {filled < 100 ? <Column style={rest}> </Column> : null}+ </Row>+ </>+ );+}++const labelStyle = {+ paddingBottom: "8px",+ color: colors.foreground,+ fontSize: "14px",+ lineHeight: "20px",+ fontWeight: "500",+};++const valueStyle = {+ paddingBottom: "8px",+ color: colors.foreground,+ fontSize: "14px",+ lineHeight: "20px",+ textAlign: "right" as const,+};++const track = {+ borderRadius: "999px",+ backgroundColor: colors.input,+};++const bar = {+ borderRadius: "999px",+ backgroundColor: colors.primary,+ fontSize: "1px",+ lineHeight: "6px",+};++const rest = {+ fontSize: "1px",+ lineHeight: "6px",+};diff --git a/packages/email/src/components/request-details.tsx b/packages/email/src/components/request-details.tsxnew file mode 100644index 000000000..d394350ee--- /dev/null+++ b/packages/email/src/components/request-details.tsx@@ -0,0 +1,113 @@+import React from "react";+import { type EmailLocale, emailHtmlLang } from "../templates/resolve-locale";+import { type DetailRow, DetailRows } from "./detail-rows";+import { type DateInput, formatDateTime } from "./format-date";+import { Frame } from "./frame";++void React;++export type RequestDevice = {+ browser?: string;+ os?: string;+};++export type RequestContext = {+ email?: string;+ instance?: string;+ requestedAt?: DateInput;+ device?: RequestDevice;+};++type Messages = {+ title: string;+ account: string;+ instance: string;+ requested: string;+ device: string;+ browserOn: (browser: string, os: string) => string;+};++const messages: Record<EmailLocale, Messages> = {+ en: {+ title: "Request details",+ account: "Account",+ instance: "Instance",+ requested: "Requested",+ device: "Device",+ browserOn: (browser, os) => `${browser} on ${os}`,+ },+ de: {+ title: "Details zur Anfrage",+ account: "Konto",+ instance: "Instanz",+ requested: "Angefordert",+ device: "Gerät",+ browserOn: (browser, os) => `${browser} auf ${os}`,+ },+ vi: {+ title: "Chi tiết yêu cầu",+ account: "Tài khoản",+ instance: "Máy chủ",+ requested: "Thời gian yêu cầu",+ device: "Thiết bị",+ browserOn: (browser, os) => `${browser} trên ${os}`,+ },+ ja: {+ title: "リクエストの詳細",+ account: "アカウント",+ instance: "インスタンス",+ requested: "リクエスト日時",+ device: "デバイス",+ browserOn: (browser, os) => `${os} の ${browser}`,+ },+ "zh-tw": {+ title: "請求詳細資料",+ account: "帳號",+ instance: "執行個體",+ requested: "請求時間",+ device: "裝置",+ browserOn: (browser, os) => `${os} 上的 ${browser}`,+ },+};++function describeDevice(copy: Messages, device?: RequestDevice) {+ if (device?.browser && device.os) {+ return copy.browserOn(device.browser, device.os);+ }+ return device?.browser ?? device?.os;+}++type RequestDetailsProps = RequestContext & {+ locale: EmailLocale;+};++export function RequestDetails({+ locale,+ email,+ instance,+ requestedAt,+ device,+}: RequestDetailsProps) {+ const copy = messages[locale];+ const rows: DetailRow[] = [+ { label: copy.account, value: email },+ { label: copy.instance, value: instance },+ {+ label: copy.requested,+ value: requestedAt+ ? formatDateTime(requestedAt, emailHtmlLang(locale))+ : undefined,+ },+ { label: copy.device, value: describeDevice(copy, device) },+ ].filter((row) => Boolean(row.value));++ if (rows.length === 0) {+ return null;+ }++ return (+ <Frame title={copy.title} panelPadding="8px 20px">+ <DetailRows rows={rows} />+ </Frame>+ );+}diff --git a/packages/email/src/components/security-reasons.ts b/packages/email/src/components/security-reasons.tsnew file mode 100644index 000000000..efa10f789--- /dev/null+++ b/packages/email/src/components/security-reasons.ts@@ -0,0 +1,29 @@+import type { EmailLocale } from "../templates/resolve-locale";++type Reason = (email: string, instance?: string) => string;++export const signInReason: Record<EmailLocale, Reason> = {+ en: (email, instance = "Kaneo") =>+ `Sent to ${email} because someone asked to sign in to ${instance}.`,+ de: (email, instance = "Kaneo") =>+ `Gesendet an ${email}, weil jemand eine Anmeldung bei ${instance} angefordert hat.`,+ vi: (email, instance = "Kaneo") =>+ `Đã gửi đến ${email} vì có người yêu cầu đăng nhập vào ${instance}.`,+ ja: (email, instance = "Kaneo") =>+ `${instance} へのサインインがリクエストされたため、${email} に送信しました。`,+ "zh-tw": (email, instance = "Kaneo") =>+ `因為有人要求登入 ${instance},所以寄送至 ${email}。`,+};++export const passwordResetReason: Record<EmailLocale, Reason> = {+ en: (email, instance = "Kaneo") =>+ `Sent to ${email} because someone asked to reset the password on ${instance}.`,+ de: (email, instance = "Kaneo") =>+ `Gesendet an ${email}, weil jemand bei ${instance} das Zurücksetzen des Passworts angefordert hat.`,+ vi: (email, instance = "Kaneo") =>+ `Đã gửi đến ${email} vì có người yêu cầu đặt lại mật khẩu trên ${instance}.`,+ ja: (email, instance = "Kaneo") =>+ `${instance} でパスワードのリセットがリクエストされたため、${email} に送信しました。`,+ "zh-tw": (email, instance = "Kaneo") =>+ `因為有人要求在 ${instance} 重設密碼,所以寄送至 ${email}。`,+};diff --git a/packages/email/src/components/spacer.tsx b/packages/email/src/components/spacer.tsxnew file mode 100644index 000000000..0a7efae00--- /dev/null+++ b/packages/email/src/components/spacer.tsx@@ -0,0 +1,19 @@+import { Text } from "@react-email/components";+import React from "react";++void React;++type SpacerProps = {+ size: number;+};++export function Spacer({ size }: SpacerProps) {+ return (+ <Text+ aria-hidden="true"+ style={{ margin: "0", fontSize: "1px", lineHeight: `${size}px` }}+ >+ + </Text>+ );+}diff --git a/packages/email/src/components/task-card.tsx b/packages/email/src/components/task-card.tsxnew file mode 100644index 000000000..a5de632b4--- /dev/null+++ b/packages/email/src/components/task-card.tsx@@ -0,0 +1,210 @@+import { Column, Row, Section, Text } from "@react-email/components";+import React from "react";+import { ThemedImg } from "./themed-img";+import { colors, shadow } from "./tokens";++void React;++export type TaskCardLabel = {+ name: string;+ color: string;+};++export type TaskCardPriority = "urgent" | "high" | "medium" | "low";++export type TaskCardDueStatus = "overdue" | "due-soon" | "far-future";++export type TaskCardProps = {+ ticket?: string;+ title: string;+ labels?: TaskCardLabel[];+ priority?: TaskCardPriority;+ priorityLabel?: string;+ dueDate?: string;+ dueStatus?: TaskCardDueStatus;+ assigneeInitials?: string;+};++const dueIcons: Record<TaskCardDueStatus, string> = {+ overdue: "due-overdue",+ "due-soon": "due-soon",+ "far-future": "due-far-future",+};++const dueColors: Record<TaskCardDueStatus, string> = {+ overdue: colors.destructiveForeground,+ "due-soon": colors.warningForeground,+ "far-future": colors.mutedForeground,+};++const dueClasses: Record<TaskCardDueStatus, string> = {+ overdue: "k-destructive",+ "due-soon": "k-warning",+ "far-future": "k-muted",+};++export function TaskCard({+ ticket,+ title,+ labels,+ priority,+ priorityLabel,+ dueDate,+ dueStatus = "far-future",+ assigneeInitials,+}: TaskCardProps) {+ const hasMeta = Boolean(priority || dueDate);++ return (+ <Section className="k-card" style={card}>+ <Row>+ <Column className="k-muted" style={ticketCell}>+ {ticket ?? ""}+ </Column>+ <Column align="right" style={avatarCell}>+ {assigneeInitials ? (+ <div className="k-chip k-text" style={avatar}>+ {assigneeInitials}+ </div>+ ) : null}+ </Column>+ </Row>+ <Text+ className="k-text-95"+ style={{+ ...titleStyle,+ marginBottom: hasMeta || labels?.length ? "10px" : "0",+ }}+ >+ {title}+ </Text>+ {labels?.length ? (+ <Text style={labelRow}>+ {labels.map((label) => (+ <span key={label.name} className="k-text-85" style={labelStyle}>+ <span+ aria-hidden="true"+ style={{ ...labelDot, color: label.color }}+ >+ ●+ </span>+ {label.name}+ </span>+ ))}+ </Text>+ ) : null}+ {hasMeta ? (+ <Text style={metaRow}>+ {priority ? (+ <span style={metaItem}>+ <ThemedImg+ name={`priority-${priority}`}+ width={12}+ height={12}+ alt={priorityLabel ?? priority}+ style={metaIcon}+ />+ </span>+ ) : null}+ {dueDate ? (+ <span+ className={dueClasses[dueStatus]}+ style={{ ...metaItem, color: dueColors[dueStatus] }}+ >+ <ThemedImg+ name={dueIcons[dueStatus]}+ width={12}+ height={12}+ style={{ ...metaIcon, marginRight: "4px" }}+ />+ {dueDate}+ </span>+ ) : null}+ </Text>+ ) : null}+ </Section>+ );+}++const card = {+ borderRadius: "10px",+ borderWidth: "1px",+ borderStyle: "solid",+ borderColor: colors.border,+ backgroundColor: colors.background,+ boxShadow: shadow,+ padding: "12px",+};++const ticketCell = {+ paddingBottom: "8px",+ verticalAlign: "top" as const,+ color: colors.mutedForeground,+ fontSize: "11px",+ lineHeight: "16px",+ fontWeight: "500",+};++const avatarCell = {+ width: "20px",+ verticalAlign: "top" as const,+};++const avatar = {+ width: "20px",+ borderRadius: "50%",+ backgroundColor: colors.muted,+ color: colors.foreground,+ fontSize: "12px",+ lineHeight: "20px",+ fontWeight: "500",+ textAlign: "center" as const,+};++const titleStyle = {+ margin: "0",+ paddingRight: "24px",+ color: colors.foreground95,+ fontSize: "15px",+ lineHeight: "20px",+ fontWeight: "500",+};++const labelRow = {+ margin: "0 0 10px",+ fontSize: "10px",+ lineHeight: "14px",+};++const labelStyle = {+ display: "inline-block",+ marginRight: "10px",+ color: colors.foreground85,+ fontSize: "10px",+ lineHeight: "14px",+ fontWeight: "500",+};++const labelDot = {+ marginRight: "5px",+ fontSize: "8px",+ lineHeight: "14px",+ verticalAlign: "1px",+};++const metaRow = {+ margin: "0",+ fontSize: "10px",+ lineHeight: "22px",+};++const metaItem = {+ display: "inline-block",+ marginRight: "10px",+ fontSize: "10px",+ lineHeight: "22px",+};++const metaIcon = {+ verticalAlign: "-2px",+};diff --git a/packages/email/src/components/theme.ts b/packages/email/src/components/theme.tsnew file mode 100644index 000000000..b2e400bd8--- /dev/null+++ b/packages/email/src/components/theme.ts@@ -0,0 +1,91 @@+export const darkColors = {+ background: "#141414",+ foreground: "#F5F5F5",+ foreground95: "#EAEAEA",+ foreground85: "#D4D4D4",+ subtle: "#A3A3A3",+ mutedForeground: "#818181",+ mutedOnFrame: "#8C8C8C",+ frame: "#1B1B1B",+ card: "#181818",+ column: "#161616",+ border: "#222222",+ input: "#272727",+ control: "#1A1A1A",+ muted: "#1E1E1E",+ primarySubtle: "#2E2E2E",+ warningForeground: "#FFB900",+ destructiveForeground: "#FF6467",+} as const;++const rules: Array<[string, string]> = [+ [".k-bg", `background-color:${darkColors.background}`],+ [".k-text", `color:${darkColors.foreground}`],+ [".k-text-95", `color:${darkColors.foreground95}`],+ [".k-text-85", `color:${darkColors.foreground85}`],+ [".k-subtle", `color:${darkColors.subtle}`],+ [".k-muted", `color:${darkColors.mutedForeground}`],+ [".k-frame .k-muted", `color:${darkColors.mutedOnFrame}`],+ [".k-warning", `color:${darkColors.warningForeground}`],+ [".k-destructive", `color:${darkColors.destructiveForeground}`],+ [".k-frame", `background-color:${darkColors.frame}`],+ [+ ".k-panel",+ `background-color:${darkColors.background};border-color:${darkColors.border}`,+ ],+ [+ ".k-card",+ `background-color:${darkColors.card};border-color:${darkColors.border}`,+ ],+ [+ ".k-column",+ `background-color:${darkColors.column};border-color:${darkColors.border}`,+ ],+ [".k-divider", `border-color:${darkColors.border}`],+ [+ ".k-slot",+ `background-color:${darkColors.control};border-color:${darkColors.input};color:${darkColors.foreground}`,+ ],+ [+ ".k-badge",+ `background-color:transparent;border-color:${darkColors.input};color:${darkColors.foreground}`,+ ],+ [".k-chip", `background-color:${darkColors.muted}`],+ [+ ".k-btn",+ `background-color:${darkColors.foreground};border-color:${darkColors.foreground};color:#262626`,+ ],+ [".k-track", `background-color:${darkColors.input}`],+ [".k-bar", `background-color:${darkColors.foreground}`],+ [".k-icon-circle", `background-color:${darkColors.primarySubtle}`],+ [".k-link", `color:${darkColors.foreground}`],+];++function important(declarations: string) {+ return declarations+ .split(";")+ .map((declaration) => `${declaration}!important`)+ .join(";");+}++const darkRules = rules+ .map(([selector, declarations]) => `${selector}{${important(declarations)}}`)+ .join("");++const outlookRules = rules+ .map(+ ([selector, declarations]) =>+ `[data-ogsc] ${selector},[data-ogsb] ${selector}{${important(declarations)}}`,+ )+ .join("");++export const themeCss = [+ ":root{color-scheme:light dark;supported-color-schemes:light dark}",+ ".k-dark-img{display:none;max-height:0;overflow:hidden}",+ "@media (prefers-color-scheme: dark){",+ darkRules,+ ".k-light-img{display:none!important;max-height:0!important}",+ ".k-dark-img{display:inline-block!important;max-height:none!important;overflow:visible!important}",+ "}",+ outlookRules,+].join("");diff --git a/packages/email/src/components/themed-img.tsx b/packages/email/src/components/themed-img.tsxnew file mode 100644index 000000000..90ac84dc8--- /dev/null+++ b/packages/email/src/components/themed-img.tsx@@ -0,0 +1,51 @@+import { Img } from "@react-email/components";+import React from "react";+import { emailAsset } from "./assets";++void React;++const outlookHidden = { msoHide: "all" } as unknown as React.CSSProperties;++type ThemedImgProps = {+ name: string;+ width: number;+ height: number;+ alt?: string;+ style?: React.CSSProperties;+};++export function ThemedImg({+ name,+ width,+ height,+ alt = "",+ style,+}: ThemedImgProps) {+ const size = { width: String(width), height: String(height) };++ return (+ <>+ <Img+ className="k-light-img"+ src={emailAsset(name)}+ alt={alt}+ {...size}+ style={{ display: "inline-block", border: "0", ...style }}+ />+ <Img+ className="k-dark-img"+ src={emailAsset(`${name}-dm`)}+ alt={alt}+ {...size}+ style={{+ ...style,+ display: "none",+ maxHeight: "0",+ overflow: "hidden",+ ...outlookHidden,+ border: "0",+ }}+ />+ </>+ );+}diff --git a/packages/email/src/components/tokens.ts b/packages/email/src/components/tokens.tsnew file mode 100644index 000000000..11ea5747b--- /dev/null+++ b/packages/email/src/components/tokens.ts@@ -0,0 +1,24 @@+export const colors = {+ background: "#FFFFFF",+ foreground: "#262626",+ foreground95: "#313131",+ foreground85: "#474747",+ mutedForeground: "#686868",+ primary: "#262626",+ primaryForeground: "#FAFAFA",+ border: "#EBEBEB",+ input: "#E6E6E6",+ muted: "#F5F5F5",+ frame: "#F7F7F7",+ column: "#FCFCFC",+ columnBorder: "#EFEFEF",+ columnHeaderBorder: "#F2F2F2",+ primarySubtle: "#E9E9E9",+ warningForeground: "#BB4D00",+ destructiveForeground: "#C10007",+} as const;++export const fontFamily =+ '"Geist Variable", Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';++export const shadow = "0 1px 2px rgba(0, 0, 0, 0.05)";diff --git a/packages/email/src/index.tsx b/packages/email/src/index.tsxindex 896f6a269..a77bb0f12 100644--- a/packages/email/src/index.tsx+++ b/packages/email/src/index.tsx@@ -8,3 +8,9 @@ export {sendWorkspaceInvitationEmail,} from "./send-email";export { isSmtpConfigured } from "./smtp-config";+export type { BoardColumnIcon } from "./components/board-column";+export type {+ TaskCardDueStatus,+ TaskCardPriority,+} from "./components/task-card";+export type { NotificationEmailTask } from "./templates/notification";diff --git a/packages/email/src/send-email.tsx b/packages/email/src/send-email.tsxindex 792d21215..b42579d02 100644--- a/packages/email/src/send-email.tsx+++ b/packages/email/src/send-email.tsx@@ -1,6 +1,7 @@import { render } from "@react-email/components";import { config } from "dotenv-mono";import * as nodemailer from "nodemailer";+import { instanceHost } from "./components/instance-host";import { getSmtpTransportOptions, isSmtpConfigured } from "./smtp-config";import { getSmtpErrorDetails } from "./smtp-error-details";import type { MagicLinkEmailProps } from "./templates/magic-link";@@ -29,7 +30,9 @@ export const sendMagicLinkEmail = async (subject: string,data: MagicLinkEmailProps,) => {- const emailTemplate = await render(MagicLinkEmail(data));+ const emailTemplate = await render(+ MagicLinkEmail({ email: to, instance: instanceHost(), ...data }),+ );try {await transporter.sendMail({from: process.env.SMTP_FROM,@@ -47,7 +50,9 @@ export const sendOtpEmail = async (subject: string,data: OtpEmailProps,) => {- const emailTemplate = await render(OtpEmail(data));+ const emailTemplate = await render(+ OtpEmail({ email: to, instance: instanceHost(), ...data }),+ );try {await transporter.sendMail({from: process.env.SMTP_FROM,@@ -67,7 +72,9 @@ export const sendPasswordResetEmail = async () => {let emailTemplate: string;try {- emailTemplate = await render(PasswordResetEmail(data));+ emailTemplate = await render(+ PasswordResetEmail({ email: to, instance: instanceHost(), ...data }),+ );} catch {console.error("Error rendering password reset email");return;@@ -103,7 +110,7 @@ export const sendWorkspaceInvitationEmail = async (try {const emailTemplate = await render(- WorkspaceInvitationEmail({ ...data, to }),+ WorkspaceInvitationEmail({ instance: instanceHost(), ...data, to }),);await transporter.sendMail({from: process.env.SMTP_FROM,@@ -147,7 +154,9 @@ export const sendTrialReminderEmail = async (subject: string,data: TrialReminderEmailProps,) => {- const emailTemplate = await render(TrialReminderEmail(data));+ const emailTemplate = await render(+ TrialReminderEmail({ email: to, ...data }),+ );try {await transporter.sendMail({from: process.env.SMTP_FROM,diff --git a/packages/email/src/templates/magic-link.test.ts b/packages/email/src/templates/magic-link.test.tsindex 9657fdf98..a61af6a23 100644--- a/packages/email/src/templates/magic-link.test.ts+++ b/packages/email/src/templates/magic-link.test.ts@@ -22,7 +22,7 @@ describe("MagicLinkEmail", () => {locale: "zh-TW",}),);- expect(html).toContain("你的安全登入連結");+ expect(html).toContain("登入 Kaneo");expect(html).toContain("Kaneo 安全性通知");});});diff --git a/packages/email/src/templates/magic-link.tsx b/packages/email/src/templates/magic-link.tsxindex 6f93060d1..28d8e54ee 100644--- a/packages/email/src/templates/magic-link.tsx+++ b/packages/email/src/templates/magic-link.tsx@@ -1,90 +1,137 @@-import { Link, Section, Text } from "@react-email/components";import React from "react";-import { resolveEmailLocale } from "./resolve-locale";-import { EmailShell, styles } from "./shell";+import { EmailButton } from "../components/email-button";+import { EmailFooter } from "../components/email-footer";+import { EmailIntro } from "../components/email-intro";+import { EmailNote } from "../components/email-note";+import { EmailShell } from "../components/email-shell";+import { FallbackLink } from "../components/fallback-link";+import { footerLinks } from "../components/footer-links";+import {+ type RequestContext,+ RequestDetails,+} from "../components/request-details";+import { signInReason } from "../components/security-reasons";+import { emailHtmlLang, resolveEmailLocale } from "./resolve-locale";void React;-export type MagicLinkEmailProps = {+export type MagicLinkEmailProps = RequestContext & {magicLink: string;locale?: string | null;};const messages = {en: {- preview: "Sign in to Kaneo",- title: "Your secure sign-in link",- subtitle: "Use this link to continue to your Kaneo workspace.",+ preview: "Use it to finish signing in. It expires in 5 minutes.",+ title: "Sign in to Kaneo",+ subtitle:+ "Use the button below to finish signing in. The link works once and expires in 5 minutes.",cta: "Sign in to Kaneo",- expiry: "This link expires in 5 minutes for your security.",- ignore: "If you didn't request this, you can ignore this email.",+ fallback: "Button not working? Paste this link into your browser:",+ ignoreTitle: "Didn't try to sign in?",+ ignore:+ "You can ignore this email. Nobody can get into your account without opening this link. Kaneo will never ask you to forward it.",footer: "Kaneo security email",},de: {- preview: "Bei Kaneo anmelden",- title: "Dein sicherer Anmeldelink",+ preview:+ "Damit schließt du die Anmeldung ab. Der Link läuft in 5 Minuten ab.",+ title: "Bei Kaneo anmelden",subtitle:- "Verwende diesen Link, um mit deinem Kaneo-Workspace fortzufahren.",+ "Verwende die Schaltfläche unten, um die Anmeldung abzuschließen. Der Link funktioniert nur einmal und läuft in 5 Minuten ab.",cta: "Bei Kaneo anmelden",- expiry: "Dieser Link laeuft aus Sicherheitsgruenden in 5 Minuten ab.",+ fallback:+ "Schaltfläche funktioniert nicht? Füge diesen Link in deinen Browser ein:",+ ignoreTitle: "Du wolltest dich nicht anmelden?",ignore:- "Wenn du das nicht angefordert hast, kannst du diese E-Mail ignorieren.",+ "Dann kannst du diese E-Mail ignorieren. Ohne diesen Link kommt niemand in dein Konto. Kaneo wird dich nie bitten, ihn weiterzuleiten.",footer: "Kaneo Sicherheits-E-Mail",},vi: {- preview: "Đăng nhập vào Kaneo",- title: "Liên kết đăng nhập an toàn của bạn",- subtitle: "Dùng liên kết này để tiếp tục vào không gian làm việc Kaneo.",+ preview:+ "Dùng liên kết này để hoàn tất đăng nhập. Liên kết hết hạn sau 5 phút.",+ title: "Đăng nhập vào Kaneo",+ subtitle:+ "Dùng nút bên dưới để hoàn tất đăng nhập. Liên kết chỉ dùng được một lần và hết hạn sau 5 phút.",cta: "Đăng nhập vào Kaneo",- expiry: "Vì lý do bảo mật, liên kết này sẽ hết hạn sau 5 phút.",- ignore: "Nếu bạn không yêu cầu điều này, bạn có thể bỏ qua email này.",+ fallback: "Nút không hoạt động? Dán liên kết này vào trình duyệt:",+ ignoreTitle: "Bạn không định đăng nhập?",+ ignore:+ "Bạn có thể bỏ qua email này. Không ai có thể vào tài khoản của bạn nếu không mở liên kết này. Kaneo sẽ không bao giờ yêu cầu bạn chuyển tiếp liên kết.",footer: "Email bảo mật Kaneo",},ja: {- preview: "Kaneo にサインイン",- title: "安全なサインインリンク",- subtitle: "このリンクから Kaneo ワークスペースにアクセスできます。",+ preview: "サインインを完了するために使用してください。有効期限は5分です。",+ title: "Kaneo にサインイン",+ subtitle:+ "下のボタンからサインインを完了してください。リンクは1回のみ有効で、5分で有効期限が切れます。",cta: "Kaneo にサインイン",- expiry: "セキュリティのため、このリンクは5分で有効期限が切れます。",- ignore: "心当たりがない場合は、このメールを無視してかまいません。",+ fallback:+ "ボタンが機能しない場合は、このリンクをブラウザに貼り付けてください:",+ ignoreTitle: "サインインしようとしていませんか?",+ ignore:+ "このメールは無視してかまいません。このリンクを開かなければ、誰もあなたのアカウントにアクセスできません。Kaneo がリンクの転送を求めることはありません。",footer: "Kaneo セキュリティメール",},"zh-tw": {- preview: "登入 Kaneo",- title: "你的安全登入連結",- subtitle: "使用此連結繼續前往你的 Kaneo 工作區。",+ preview: "用它來完成登入。連結將在 5 分鐘後失效。",+ title: "登入 Kaneo",+ subtitle: "點選下方按鈕以完成登入。連結只能使用一次,並將在 5 分鐘後失效。",cta: "登入 Kaneo",- expiry: "為了你的帳號安全,此連結將在 5 分鐘後失效。",- ignore: "如果這不是你本人的操作,請忽略這封郵件。",+ fallback: "按鈕無法使用?請將此連結貼到瀏覽器:",+ ignoreTitle: "沒有嘗試登入?",+ ignore:+ "你可以忽略這封郵件。沒有開啟此連結,任何人都無法進入你的帳號。Kaneo 絕不會要求你轉寄此連結。",footer: "Kaneo 安全性通知",},} as const;-const MagicLinkEmail = ({ magicLink, locale }: MagicLinkEmailProps) => {- const copy = messages[resolveEmailLocale(locale)];+const MagicLinkEmail = ({+ magicLink,+ locale,+ email,+ instance,+ requestedAt,+ device,+}: MagicLinkEmailProps) => {+ const emailLocale = resolveEmailLocale(locale);+ const copy = messages[emailLocale];return (<EmailShell- preview={copy.preview}title={copy.title}- subtitle={copy.subtitle}+ preview={copy.preview}+ lang={emailHtmlLang(emailLocale)}>- <Section>- <Link style={styles.button} href={magicLink}>- {copy.cta}- </Link>- <Text style={styles.paragraph}>{copy.expiry}</Text>- <Text style={styles.muted}>{copy.ignore}</Text>- <Section style={styles.divider} />- <Text style={styles.footer}>{copy.footer}</Text>- </Section>+ <EmailIntro title={copy.title} subtitle={copy.subtitle} />+ <EmailButton href={magicLink} icon="log-in-light">+ {copy.cta}+ </EmailButton>+ <FallbackLink label={copy.fallback} href={magicLink} />+ <RequestDetails+ locale={emailLocale}+ email={email}+ instance={instance}+ requestedAt={requestedAt}+ device={device}+ />+ <EmailNote title={copy.ignoreTitle}>{copy.ignore}</EmailNote>+ <EmailFooter+ title={copy.footer}+ reason={email ? signInReason[emailLocale](email, instance) : undefined}+ links={footerLinks(emailLocale)}+ /></EmailShell>);};MagicLinkEmail.PreviewProps = {- magicLink: "https://kaneo.app",+ magicLink: "https://cloud.kaneo.app/api/auth/magic-link/verify?token=example",locale: "en-US",+ email: "[email protected]",+ instance: "cloud.kaneo.app",+ requestedAt: "2026-10-11T14:12:00.000Z",+ device: { browser: "Safari", os: "iPhone" },} as MagicLinkEmailProps;export default MagicLinkEmail;diff --git a/packages/email/src/templates/notification.test.ts b/packages/email/src/templates/notification.test.tsindex f562be312..b1e843650 100644--- a/packages/email/src/templates/notification.test.ts+++ b/packages/email/src/templates/notification.test.ts@@ -29,4 +29,30 @@ describe("NotificationEmail", () => {expect(html).toContain("在 Kaneo 中開啟");expect(html).toContain("有一則通知符合你的通知設定。");});++ it("renders the task card with localized priority and due date", async () => {+ const html = await render(+ createElement(NotificationEmail, {+ title: "Task assigned to you",+ message: "You were assigned to Redesign emails.",+ actionUrl: "https://kaneo.example/task/1",+ breadcrumb: "Acme / Website",+ task: {+ ticket: "KAN-128",+ title: "Redesign emails",+ labels: [{ name: "Design", color: "#8E51FF" }],+ priority: "high",+ dueDate: new Date("2026-10-14T00:00:00Z"),+ dueStatus: "due-soon",+ column: { name: "In progress", icon: "circle-dot", count: 3 },+ },+ }),+ );+ expect(html).toContain("KAN-128");+ expect(html).toContain("Design");+ expect(html).toContain('alt="High priority"');+ expect(html).toContain("Oct 14");+ expect(html).toContain("In progress");+ expect(html).toContain("Open task");+ });});diff --git a/packages/email/src/templates/notification.tsx b/packages/email/src/templates/notification.tsxindex f85d6686d..61393f8b3 100644--- a/packages/email/src/templates/notification.tsx+++ b/packages/email/src/templates/notification.tsx@@ -1,16 +1,44 @@-import { Link, Section, Text } from "@react-email/components";+import { Text } from "@react-email/components";import React from "react";-import { resolveEmailLocale } from "./resolve-locale";-import { EmailShell, styles } from "./shell";+import { BoardColumn, type BoardColumnIcon } from "../components/board-column";+import { EmailButton } from "../components/email-button";+import { EmailFooter } from "../components/email-footer";+import { EmailIntro } from "../components/email-intro";+import { EmailShell } from "../components/email-shell";+import { footerLinks } from "../components/footer-links";+import { type DateInput, formatShortDate } from "../components/format-date";+import { Spacer } from "../components/spacer";+import {+ TaskCard,+ type TaskCardPriority,+ type TaskCardProps,+} from "../components/task-card";+import { colors } from "../components/tokens";+import { emailHtmlLang, resolveEmailLocale } from "./resolve-locale";void React;+export type NotificationEmailTask = Omit<+ TaskCardProps,+ "dueDate" | "priorityLabel"+> & {+ dueDate?: DateInput;+ column?: {+ name: string;+ icon?: BoardColumnIcon;+ count?: number;+ };+};+export type NotificationEmailProps = {title: string;message: string;actionUrl?: string | null;actionLabel?: string;locale?: string | null;+ breadcrumb?: string;+ task?: NotificationEmailTask;+ settingsUrl?: string;};const messages = {@@ -19,31 +47,71 @@ const messages = {subtitle: "A notification matched your delivery preferences.",footer: "Kaneo notification",actionLabel: "Open in Kaneo",+ openTask: "Open task",+ manage: "Manage notifications",+ priority: {+ urgent: "Urgent priority",+ high: "High priority",+ medium: "Medium priority",+ low: "Low priority",+ },},de: {preview: "Du hast eine neue Kaneo-Benachrichtigung",subtitle:"Eine Benachrichtigung entspricht deinen Zustellungs-Einstellungen.",- footer: "Kaneo-Benachrichtigung",- actionLabel: "In Kaneo oeffnen",+ footer: "Kaneo Benachrichtigung",+ actionLabel: "In Kaneo öffnen",+ openTask: "Aufgabe öffnen",+ manage: "Benachrichtigungen verwalten",+ priority: {+ urgent: "Dringende Priorität",+ high: "Hohe Priorität",+ medium: "Mittlere Priorität",+ low: "Niedrige Priorität",+ },},vi: {preview: "Bạn có thông báo mới từ Kaneo",subtitle: "Một thông báo khớp với tùy chọn nhận thông báo của bạn.",footer: "Thông báo Kaneo",actionLabel: "Mở trong Kaneo",+ openTask: "Mở công việc",+ manage: "Quản lý thông báo",+ priority: {+ urgent: "Ưu tiên khẩn cấp",+ high: "Ưu tiên cao",+ medium: "Ưu tiên trung bình",+ low: "Ưu tiên thấp",+ },},ja: {preview: "Kaneo の新しい通知",subtitle: "配信設定に一致する通知がありました。",footer: "Kaneo 通知",actionLabel: "Kaneo で開く",+ openTask: "タスクを開く",+ manage: "通知を管理",+ priority: {+ urgent: "優先度: 緊急",+ high: "優先度: 高",+ medium: "優先度: 中",+ low: "優先度: 低",+ },},"zh-tw": {preview: "你有一則新的 Kaneo 通知",subtitle: "有一則通知符合你的通知設定。",footer: "Kaneo 通知",actionLabel: "在 Kaneo 中開啟",+ openTask: "開啟任務",+ manage: "管理通知",+ priority: {+ urgent: "緊急優先",+ high: "高優先",+ medium: "中優先",+ low: "低優先",+ },},} as const;@@ -53,29 +121,95 @@ const NotificationEmail = ({actionUrl,actionLabel,locale,+ breadcrumb,+ task,+ settingsUrl,}: NotificationEmailProps) => {- const copy = messages[resolveEmailLocale(locale)];+ const emailLocale = resolveEmailLocale(locale);+ const copy = messages[emailLocale];+ const lang = emailHtmlLang(emailLocale);+ const priority: TaskCardPriority | undefined = task?.priority;+ const card = task ? (+ <TaskCard+ {...task}+ dueDate={task.dueDate ? formatShortDate(task.dueDate, lang) : undefined}+ priorityLabel={priority ? copy.priority[priority] : undefined}+ />+ ) : null;return (- <EmailShell preview={copy.preview} title={title} subtitle={copy.subtitle}>- <Section>- <Text style={styles.paragraph}>{message}</Text>- {actionUrl ? (- <Link style={styles.button} href={actionUrl}>- {actionLabel ?? copy.actionLabel}- </Link>- ) : null}- <Section style={styles.divider} />- <Text style={styles.footer}>{copy.footer}</Text>- </Section>+ <EmailShell+ title={title}+ preview={`${message} ${copy.preview}`}+ lang={lang}+ >+ <EmailIntro title={title} subtitle={message} />+ {breadcrumb ? (+ <Text className="k-muted" style={breadcrumbStyle}>+ {breadcrumb}+ </Text>+ ) : null}+ {task?.column ? (+ <BoardColumn+ name={task.column.name}+ icon={task.column.icon}+ count={task.column.count}+ >+ {card}+ </BoardColumn>+ ) : (+ card+ )}+ {actionUrl ? (+ <>+ {task ? <Spacer size={20} /> : null}+ <EmailButton href={actionUrl} icon="arrow-up-right-light">+ {actionLabel ?? (task ? copy.openTask : copy.actionLabel)}+ </EmailButton>+ </>+ ) : null}+ <Spacer size={40} />+ <EmailFooter+ title={copy.footer}+ reason={copy.subtitle}+ links={footerLinks(+ emailLocale,+ settingsUrl ? [{ label: copy.manage, href: settingsUrl }] : [],+ )}+ /></EmailShell>);};+const breadcrumbStyle = {+ margin: "-16px 0 20px",+ color: colors.mutedForeground,+ fontSize: "14px",+ lineHeight: "20px",+};+NotificationEmail.PreviewProps = {- title: "Task assigned to you",- message: "You were assigned to Design account notifications.",- actionUrl: "https://kaneo.app",+ title: "Sarah Chen assigned you a task",+ message: "You were assigned to Redesign transactional emails.",+ actionUrl: "https://cloud.kaneo.app/acme/task/KAN-128",+ locale: "en-US",+ breadcrumb: "Acme / Website",+ settingsUrl:+ "https://cloud.kaneo.app/dashboard/settings/account/notifications",+ task: {+ ticket: "KAN-128",+ title: "Redesign transactional emails",+ labels: [+ { name: "Design", color: "#8E51FF" },+ { name: "Email", color: "#00BC7D" },+ ],+ priority: "high",+ priorityLabel: "High priority",+ dueDate: "2026-10-14T00:00:00.000Z",+ dueStatus: "due-soon",+ assigneeInitials: "MK",+ column: { name: "In progress", icon: "circle-dot", count: 3 },+ },} as NotificationEmailProps;export default NotificationEmail;diff --git a/packages/email/src/templates/otp.test.ts b/packages/email/src/templates/otp.test.tsindex 49dc8111c..1d164b341 100644--- a/packages/email/src/templates/otp.test.ts+++ b/packages/email/src/templates/otp.test.ts@@ -32,4 +32,29 @@ describe("OtpEmail", () => {expect(html).toContain("確認コード");expect(html).toContain("Kaneo セキュリティメール");});++ it("renders the request details in the recipient's language", async () => {+ const context = {+ otp: "482913",+ email: "[email protected]",+ instance: "kaneo.example",+ requestedAt: new Date("2026-10-11T14:12:00Z"),+ device: { browser: "Safari", os: "iPhone" },+ };+ const english = await render(createElement(OtpEmail, context));+ expect(english).toContain("Request details");+ expect(english).toContain("Safari on iPhone");+ expect(english).toContain("Oct 11, 2026");+ expect(english).toContain("kaneo.example");++ const german = await render(+ createElement(OtpEmail, { ...context, locale: "de-DE" }),+ );+ expect(german).toContain("Safari auf iPhone");+ });++ it("hides the request details when nothing is known", async () => {+ const html = await render(createElement(OtpEmail, { otp: "482913" }));+ expect(html).not.toContain("Request details");+ });});diff --git a/packages/email/src/templates/otp.tsx b/packages/email/src/templates/otp.tsxindex fc2a6bd43..e374962a0 100644--- a/packages/email/src/templates/otp.tsx+++ b/packages/email/src/templates/otp.tsx@@ -1,92 +1,141 @@-import { Section, Text } from "@react-email/components";import React from "react";+import { EmailFooter } from "../components/email-footer";+import { EmailIntro } from "../components/email-intro";+import { EmailNote } from "../components/email-note";+import { EmailShell } from "../components/email-shell";+import { footerLinks } from "../components/footer-links";+import { OtpCode } from "../components/otp-code";+import {+ type RequestContext,+ RequestDetails,+} from "../components/request-details";+import { signInReason } from "../components/security-reasons";import { OTP_EXPIRY_SECONDS } from "../otp-expiry";-import { resolveEmailLocale } from "./resolve-locale";-import { EmailShell, styles } from "./shell";+import { emailHtmlLang, resolveEmailLocale } from "./resolve-locale";void React;-export type OtpEmailProps = {+export type OtpEmailProps = RequestContext & {otp: string;locale?: string | null;};+const minutes = OTP_EXPIRY_SECONDS / 60;+const messages = {en: {- preview: "Your Kaneo verification code",- title: "Your verification code",- subtitle: "Enter this one-time code to finish signing in.",+ preview: `Enter it on the sign-in page to continue. It expires in ${minutes} minutes.`,+ title: "Sign in to Kaneo",+ subtitle:+ "Enter this code on the sign-in page to finish signing in. It works once.",+ codeLabel: "Verification code",code: "is your Kaneo verification code.",- expiry: `This code expires in ${OTP_EXPIRY_SECONDS / 60} minutes.`,- ignore: "If you didn't request this, you can ignore this email.",+ expiry: `This code expires in ${minutes} minutes.`,+ ignoreTitle: "Didn't try to sign in?",+ ignore:+ "You can ignore this email. Nobody can get into your account without this code. Kaneo will never ask you to share it.",footer: "Kaneo security email",},de: {- preview: "Dein Kaneo Bestätigungscode",- title: "Dein Bestätigungscode",- subtitle: "Gib diesen Einmalcode ein, um die Anmeldung abzuschließen.",+ preview: `Gib ihn auf der Anmeldeseite ein, um fortzufahren. Er läuft in ${minutes} Minuten ab.`,+ title: "Bei Kaneo anmelden",+ subtitle:+ "Gib diesen Code auf der Anmeldeseite ein, um die Anmeldung abzuschließen. Er funktioniert nur einmal.",+ codeLabel: "Bestätigungscode",code: "ist dein Kaneo Bestätigungscode.",- expiry: `Dieser Code läuft in ${OTP_EXPIRY_SECONDS / 60} Minuten ab.`,+ expiry: `Dieser Code läuft in ${minutes} Minuten ab.`,+ ignoreTitle: "Du wolltest dich nicht anmelden?",ignore:- "Wenn du das nicht angefordert hast, kannst du diese E-Mail ignorieren.",+ "Dann kannst du diese E-Mail ignorieren. Ohne diesen Code kommt niemand in dein Konto. Kaneo wird dich nie bitten, ihn weiterzugeben.",footer: "Kaneo Sicherheits-E-Mail",},vi: {- preview: "Mã xác minh Kaneo của bạn",- title: "Mã xác minh của bạn",- subtitle: "Nhập mã dùng một lần này để hoàn tất đăng nhập.",+ preview: `Nhập mã này trên trang đăng nhập để tiếp tục. Mã hết hạn sau ${minutes} phút.`,+ title: "Đăng nhập vào Kaneo",+ subtitle:+ "Nhập mã này trên trang đăng nhập để hoàn tất đăng nhập. Mã chỉ dùng được một lần.",+ codeLabel: "Mã xác minh",code: "là mã xác minh Kaneo của bạn.",- expiry: `Mã này sẽ hết hạn sau ${OTP_EXPIRY_SECONDS / 60} phút.`,- ignore: "Nếu bạn không yêu cầu điều này, bạn có thể bỏ qua email này.",+ expiry: `Mã này sẽ hết hạn sau ${minutes} phút.`,+ ignoreTitle: "Bạn không định đăng nhập?",+ ignore:+ "Bạn có thể bỏ qua email này. Không ai có thể vào tài khoản của bạn nếu không có mã này. Kaneo sẽ không bao giờ yêu cầu bạn chia sẻ mã.",footer: "Email bảo mật Kaneo",},ja: {- preview: "Kaneo の確認コード",- title: "確認コード",+ preview: `サインインページで入力して続行してください。有効期限は${minutes}分です。`,+ title: "Kaneo にサインイン",subtitle:- "サインインを完了するには、このワンタイムコードを入力してください。",+ "サインインページでこのコードを入力して、サインインを完了してください。コードは1回のみ有効です。",+ codeLabel: "確認コード",code: "はあなたの Kaneo 確認コードです。",- expiry: `このコードの有効期限は${OTP_EXPIRY_SECONDS / 60}分です。`,- ignore: "心当たりがない場合は、このメールを無視してかまいません。",+ expiry: `このコードの有効期限は${minutes}分です。`,+ ignoreTitle: "サインインしようとしていませんか?",+ ignore:+ "このメールは無視してかまいません。このコードがなければ、誰もあなたのアカウントにアクセスできません。Kaneo がコードの共有を求めることはありません。",footer: "Kaneo セキュリティメール",},"zh-tw": {- preview: "你的 Kaneo 驗證碼",- title: "你的驗證碼",- subtitle: "輸入這組一次性驗證碼以完成登入。",+ preview: `在登入頁面輸入以繼續。驗證碼將在 ${minutes} 分鐘後失效。`,+ title: "登入 Kaneo",+ subtitle: "在登入頁面輸入此驗證碼以完成登入。驗證碼只能使用一次。",+ codeLabel: "驗證碼",code: "是你的 Kaneo 驗證碼。",- expiry: `此驗證碼將在 ${OTP_EXPIRY_SECONDS / 60} 分鐘後失效。`,- ignore: "如果這不是你本人的操作,請忽略這封郵件。",+ expiry: `此驗證碼將在 ${minutes} 分鐘後失效。`,+ ignoreTitle: "沒有嘗試登入?",+ ignore:+ "你可以忽略這封郵件。沒有這組驗證碼,任何人都無法進入你的帳號。Kaneo 絕不會要求你分享驗證碼。",footer: "Kaneo 安全性通知",},} as const;-const OtpEmail = ({ otp, locale }: OtpEmailProps) => {- const copy = messages[resolveEmailLocale(locale)];+const OtpEmail = ({+ otp,+ locale,+ email,+ instance,+ requestedAt,+ device,+}: OtpEmailProps) => {+ const emailLocale = resolveEmailLocale(locale);+ const copy = messages[emailLocale];return (<EmailShell- preview={copy.preview}title={copy.title}- subtitle={copy.subtitle}+ preview={copy.preview}+ lang={emailHtmlLang(emailLocale)}>- <Section>- <Text style={styles.paragraph}>- {otp} {copy.code}- </Text>- <Text style={styles.code}>{otp}</Text>- <Text style={styles.paragraph}>{copy.expiry}</Text>- <Text style={styles.muted}>{copy.ignore}</Text>- <Section style={styles.divider} />- <Text style={styles.footer}>{copy.footer}</Text>- </Section>+ <EmailIntro title={copy.title} subtitle={copy.subtitle} />+ <OtpCode+ code={otp}+ label={copy.codeLabel}+ hint={`${otp} ${copy.code} ${copy.expiry}`}+ />+ <RequestDetails+ locale={emailLocale}+ email={email}+ instance={instance}+ requestedAt={requestedAt}+ device={device}+ />+ <EmailNote title={copy.ignoreTitle}>{copy.ignore}</EmailNote>+ <EmailFooter+ title={copy.footer}+ reason={email ? signInReason[emailLocale](email, instance) : undefined}+ links={footerLinks(emailLocale)}+ /></EmailShell>);};OtpEmail.PreviewProps = {- otp: "123456",+ otp: "482913",locale: "en-US",+ email: "[email protected]",+ instance: "cloud.kaneo.app",+ requestedAt: "2026-10-11T14:12:00.000Z",+ device: { browser: "Safari", os: "iPhone" },} as OtpEmailProps;export default OtpEmail;diff --git a/packages/email/src/templates/password-reset.tsx b/packages/email/src/templates/password-reset.tsxindex 51b31a244..bec3483dc 100644--- a/packages/email/src/templates/password-reset.tsx+++ b/packages/email/src/templates/password-reset.tsx@@ -1,11 +1,21 @@-import { Link, Section, Text } from "@react-email/components";import React from "react";-import { resolveEmailLocale } from "./resolve-locale";-import { EmailShell, styles } from "./shell";+import { EmailButton } from "../components/email-button";+import { EmailFooter } from "../components/email-footer";+import { EmailIntro } from "../components/email-intro";+import { EmailNote } from "../components/email-note";+import { EmailShell } from "../components/email-shell";+import { FallbackLink } from "../components/fallback-link";+import { footerLinks } from "../components/footer-links";+import {+ type RequestContext,+ RequestDetails,+} from "../components/request-details";+import { passwordResetReason } from "../components/security-reasons";+import { emailHtmlLang, resolveEmailLocale } from "./resolve-locale";void React;-export type PasswordResetEmailProps = {+export type PasswordResetEmailProps = RequestContext & {resetLink: string;userName?: string;locale?: string | null;@@ -13,61 +23,79 @@ export type PasswordResetEmailProps = {const messages = {en: {- preview: "Reset your Kaneo password",+ preview:+ "Use the link inside to choose a new password. It expires in 1 hour.",title: "Reset your password",subtitleWithName: (name: string) =>- `Hi ${name}, use the button below to set a new password.`,- subtitleDefault: "Use the button below to set a new password.",+ `Hi ${name}, use the button below to choose a new password. The link works once and expires in 1 hour.`,+ subtitleDefault:+ "Use the button below to choose a new password. The link works once and expires in 1 hour.",cta: "Reset password",- expiry: "This reset link expires in 1 hour.",- ignore: "If you didn't request this, no changes will be made.",+ fallback: "Button not working? Paste this link into your browser:",+ ignoreTitle: "Didn't ask for this?",+ ignore:+ "You can ignore this email. Your password stays the same until someone opens this link and sets a new one.",footer: "Kaneo security email",},de: {- preview: "Setze dein Kaneo-Passwort zurück",+ preview:+ "Über den Link darin wählst du ein neues Passwort. Er läuft in 1 Stunde ab.",title: "Passwort zurücksetzen",subtitleWithName: (name: string) =>- `Hallo ${name}, verwende die Schaltfläche unten, um ein neues Passwort festzulegen.`,+ `Hallo ${name}, verwende die Schaltfläche unten, um ein neues Passwort festzulegen. Der Link funktioniert nur einmal und läuft in 1 Stunde ab.`,subtitleDefault:- "Verwende die Schaltfläche unten, um ein neues Passwort festzulegen.",+ "Verwende die Schaltfläche unten, um ein neues Passwort festzulegen. Der Link funktioniert nur einmal und läuft in 1 Stunde ab.",cta: "Passwort zurücksetzen",- expiry: "Dieser Link läuft in 1 Stunde ab.",+ fallback:+ "Schaltfläche funktioniert nicht? Füge diesen Link in deinen Browser ein:",+ ignoreTitle: "Du hast das nicht angefordert?",ignore:- "Wenn du das nicht angefordert hast, werden keine Änderungen vorgenommen.",+ "Dann kannst du diese E-Mail ignorieren. Dein Passwort bleibt gleich, bis jemand diesen Link öffnet und ein neues festlegt.",footer: "Kaneo Sicherheits-E-Mail",},vi: {- preview: "Đặt lại mật khẩu Kaneo của bạn",+ preview:+ "Dùng liên kết bên trong để đặt mật khẩu mới. Liên kết hết hạn sau 1 giờ.",title: "Đặt lại mật khẩu",subtitleWithName: (name: string) =>- `Chào ${name}, hãy dùng nút bên dưới để đặt mật khẩu mới.`,- subtitleDefault: "Hãy dùng nút bên dưới để đặt mật khẩu mới.",+ `Chào ${name}, hãy dùng nút bên dưới để đặt mật khẩu mới. Liên kết chỉ dùng được một lần và hết hạn sau 1 giờ.`,+ subtitleDefault:+ "Hãy dùng nút bên dưới để đặt mật khẩu mới. Liên kết chỉ dùng được một lần và hết hạn sau 1 giờ.",cta: "Đặt lại mật khẩu",- expiry: "Liên kết đặt lại này sẽ hết hạn sau 1 giờ.",+ fallback: "Nút không hoạt động? Dán liên kết này vào trình duyệt:",+ ignoreTitle: "Bạn không yêu cầu điều này?",ignore:- "Nếu bạn không yêu cầu điều này, sẽ không có thay đổi nào được thực hiện.",+ "Bạn có thể bỏ qua email này. Mật khẩu của bạn sẽ giữ nguyên cho đến khi có người mở liên kết này và đặt mật khẩu mới.",footer: "Email bảo mật Kaneo",},ja: {- preview: "Kaneo のパスワードをリセット",+ preview:+ "メール内のリンクから新しいパスワードを設定してください。有効期限は1時間です。",title: "パスワードのリセット",subtitleWithName: (name: string) =>- `${name} さん、下のボタンから新しいパスワードを設定してください。`,- subtitleDefault: "下のボタンから新しいパスワードを設定してください。",+ `${name} さん、下のボタンから新しいパスワードを設定してください。リンクは1回のみ有効で、1時間で有効期限が切れます。`,+ subtitleDefault:+ "下のボタンから新しいパスワードを設定してください。リンクは1回のみ有効で、1時間で有効期限が切れます。",cta: "パスワードをリセット",- expiry: "このリンクの有効期限は1時間です。",- ignore: "心当たりがない場合は、変更は行われません。",+ fallback:+ "ボタンが機能しない場合は、このリンクをブラウザに貼り付けてください:",+ ignoreTitle: "心当たりがありませんか?",+ ignore:+ "このメールは無視してかまいません。誰かがこのリンクを開いて新しいパスワードを設定しない限り、パスワードは変更されません。",footer: "Kaneo セキュリティメール",},"zh-tw": {- preview: "重設你的 Kaneo 密碼",+ preview: "使用信中的連結設定新密碼。連結將在 1 小時後失效。",title: "重設密碼",subtitleWithName: (name: string) =>- `${name} 你好,請點選下方按鈕設定新密碼。`,- subtitleDefault: "請點選下方按鈕設定新密碼。",+ `${name} 你好,請點選下方按鈕設定新密碼。連結只能使用一次,並將在 1 小時後失效。`,+ subtitleDefault:+ "請點選下方按鈕設定新密碼。連結只能使用一次,並將在 1 小時後失效。",cta: "重設密碼",- expiry: "此重設連結將在 1 小時後失效。",- ignore: "如果這不是你本人的操作,你的密碼不會有任何變更。",+ fallback: "按鈕無法使用?請將此連結貼到瀏覽器:",+ ignoreTitle: "沒有提出這項要求?",+ ignore:+ "你可以忽略這封郵件。在有人開啟此連結並設定新密碼之前,你的密碼都不會變更。",footer: "Kaneo 安全性通知",},} as const;@@ -76,33 +104,57 @@ const PasswordResetEmail = ({resetLink,userName,locale,+ email,+ instance,+ requestedAt,+ device,}: PasswordResetEmailProps) => {- const copy = messages[resolveEmailLocale(locale)];+ const emailLocale = resolveEmailLocale(locale);+ const copy = messages[emailLocale];return (<EmailShell- preview={copy.preview}title={copy.title}- subtitle={- userName ? copy.subtitleWithName(userName) : copy.subtitleDefault- }+ preview={copy.preview}+ lang={emailHtmlLang(emailLocale)}>- <Section>- <Link style={styles.button} href={resetLink}>- {copy.cta}- </Link>- <Text style={styles.paragraph}>{copy.expiry}</Text>- <Text style={styles.muted}>{copy.ignore}</Text>- <Section style={styles.divider} />- <Text style={styles.footer}>{copy.footer}</Text>- </Section>+ <EmailIntro+ title={copy.title}+ subtitle={+ userName ? copy.subtitleWithName(userName) : copy.subtitleDefault+ }+ />+ <EmailButton href={resetLink} icon="key-round-light">+ {copy.cta}+ </EmailButton>+ <FallbackLink label={copy.fallback} href={resetLink} />+ <RequestDetails+ locale={emailLocale}+ email={email}+ instance={instance}+ requestedAt={requestedAt}+ device={device}+ />+ <EmailNote title={copy.ignoreTitle}>{copy.ignore}</EmailNote>+ <EmailFooter+ title={copy.footer}+ reason={+ email ? passwordResetReason[emailLocale](email, instance) : undefined+ }+ links={footerLinks(emailLocale)}+ /></EmailShell>);};PasswordResetEmail.PreviewProps = {- resetLink: "https://kaneo.app/auth/reset-password?token=example",- userName: "Jane",+ resetLink: "https://cloud.kaneo.app/auth/reset-password?token=example",+ userName: "Maya",+ locale: "en-US",+ email: "[email protected]",+ instance: "cloud.kaneo.app",+ requestedAt: "2026-10-11T14:12:00.000Z",+ device: { browser: "Safari", os: "iPhone" },} as PasswordResetEmailProps;export default PasswordResetEmail;diff --git a/packages/email/src/templates/resolve-locale.ts b/packages/email/src/templates/resolve-locale.tsindex 20bfa7171..26997fafc 100644--- a/packages/email/src/templates/resolve-locale.ts+++ b/packages/email/src/templates/resolve-locale.ts@@ -1,9 +1,17 @@const supportedLocales = ["en", "de", "vi", "ja", "zh-tw"] as const;-type EmailLocale = (typeof supportedLocales)[number];+export type EmailLocale = (typeof supportedLocales)[number];const defaultLocale: EmailLocale = "en";+const htmlLangs: Record<EmailLocale, string> = {+ en: "en",+ de: "de",+ vi: "vi",+ ja: "ja",+ "zh-tw": "zh-TW",+};+export function resolveEmailLocale(locale?: string | null): EmailLocale {if (!locale) return defaultLocale;@@ -18,3 +26,7 @@ export function resolveEmailLocale(locale?: string | null): EmailLocale {return defaultLocale;}++export function emailHtmlLang(locale: EmailLocale): string {+ return htmlLangs[locale];+}diff --git a/packages/email/src/templates/shell.tsx b/packages/email/src/templates/shell.tsxdeleted file mode 100644index 3adc77825..000000000--- a/packages/email/src/templates/shell.tsx+++ /dev/null@@ -1,145 +0,0 @@-import {- Body,- Container,- Head,- Heading,- Html,- Preview,- Section,- Text,-} from "@react-email/components";-import React from "react";--void React;--type EmailShellProps = {- preview: string;- title: string;- subtitle?: string;- children: React.ReactNode;-};--export function EmailShell({- preview,- title,- subtitle,- children,-}: EmailShellProps) {- return (- <Html>- <Head />- <Preview>{preview}</Preview>- <Body style={main}>- <Container style={container}>- <Section style={content}>- <Text style={badge}>Kaneo</Text>- <Heading style={heading}>{title}</Heading>- {subtitle ? <Text style={subtitleText}>{subtitle}</Text> : null}- <Section style={body}>{children}</Section>- </Section>- </Container>- </Body>- </Html>- );-}--export const styles = {- paragraph: {- margin: "0 0 14px",- color: "#262626",- fontSize: "14px",- lineHeight: "22px",- },- muted: {- margin: "0",- color: "#737373",- fontSize: "13px",- lineHeight: "20px",- },- button: {- display: "inline-block",- margin: "8px 0 14px",- padding: "11px 20px",- borderRadius: "10px",- border: "1px solid #262626",- color: "#fafafa",- backgroundColor: "#262626",- textDecoration: "none",- fontSize: "14px",- fontWeight: "600",- boxShadow: "inset 0 1px rgba(255, 255, 255, 0.16)",- },- code: {- margin: "6px 0 14px",- textAlign: "center" as const,- padding: "14px 20px",- borderRadius: "10px",- border: "1px solid rgba(0, 0, 0, 0.1)",- backgroundColor: "rgba(0, 0, 0, 0.04)",- color: "#171717",- fontSize: "30px",- letterSpacing: "8px",- fontWeight: "600",- },- divider: {- borderTop: "1px solid rgba(0, 0, 0, 0.08)",- margin: "16px 0",- },- footer: {- margin: "0",- color: "#737373",- fontSize: "12px",- lineHeight: "18px",- },-};--const main = {- backgroundColor: "#ffffff",- margin: "0",- padding: "20px 12px",- fontFamily:- '"Geist Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',-};--const container = {- margin: "0 auto",- maxWidth: "560px",- borderRadius: "16px",- border: "1px solid rgba(0, 0, 0, 0.08)",- overflow: "hidden",- backgroundColor: "#ffffff",- boxShadow: "0 1px 2px rgba(0, 0, 0, 0.06)",-};--const content = {- padding: "24px",-};--const badge = {- margin: "0 0 8px",- color: "#262626",- fontWeight: "600",- fontSize: "12px",- letterSpacing: "0.1em",- textTransform: "uppercase" as const,-};--const heading = {- margin: "0 0 8px",- color: "#262626",- fontSize: "24px",- lineHeight: "31px",- fontFamily:- '"Geist Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',-};--const subtitleText = {- margin: "0 0 18px",- color: "#525252",- fontSize: "14px",- lineHeight: "22px",-};--const body = {- margin: "0",-};diff --git a/packages/email/src/templates/static b/packages/email/src/templates/staticnew file mode 120000index 000000000..6664edb47--- /dev/null+++ b/packages/email/src/templates/static@@ -0,0 +1 @@+../../../../apps/web/public/email\ No newline at end of filediff --git a/packages/email/src/templates/trial-reminder.tsx b/packages/email/src/templates/trial-reminder.tsxindex e0188c2f0..e21555c80 100644--- a/packages/email/src/templates/trial-reminder.tsx+++ b/packages/email/src/templates/trial-reminder.tsx@@ -1,6 +1,14 @@-import { Link, Section, Text } from "@react-email/components";import React from "react";-import { EmailShell, styles } from "./shell";+import { EmailButton } from "../components/email-button";+import { EmailFooter } from "../components/email-footer";+import { EmailIntro } from "../components/email-intro";+import { EmailNote } from "../components/email-note";+import { EmailShell } from "../components/email-shell";+import { footerLinks } from "../components/footer-links";+import { type DateInput, formatShortDate } from "../components/format-date";+import { Frame } from "../components/frame";+import { Progress } from "../components/progress";+import { Spacer } from "../components/spacer";void React;@@ -8,9 +16,22 @@ export type TrialReminderEmailProps = {workspaceName: string;daysLeft: number;billingUrl: string;+ trialDays?: number;+ endsAt?: DateInput;+ email?: string;};-function title(workspaceName: string, daysLeft: number) {+function title(daysLeft: number) {+ if (daysLeft <= 0) {+ return "Your trial has ended";+ }+ if (daysLeft === 1) {+ return "Your trial ends tomorrow";+ }+ return `Your trial ends in ${daysLeft} days`;+}++function preview(workspaceName: string, daysLeft: number) {if (daysLeft <= 0) {return `The trial for ${workspaceName} has ended`;}@@ -24,36 +45,76 @@ function subtitle(daysLeft: number) {if (daysLeft <= 0) {return "Your workspace is read-only until you choose a plan. Nothing has been deleted, and your data is still there.";}- return "Choose a plan to keep creating and editing when the trial ends.";+ return "Choose a plan to keep creating and editing when the trial ends. Your projects, tasks and members stay exactly as they are.";+}++function remaining(daysLeft: number) {+ if (daysLeft <= 0) {+ return "Ended";+ }+ return daysLeft === 1 ? "1 day left" : `${daysLeft} days left`;}const TrialReminderEmail = ({workspaceName,daysLeft,billingUrl,+ trialDays = 14,+ endsAt,+ email,}: TrialReminderEmailProps) => {+ const used = Math.min(trialDays, Math.max(0, trialDays - daysLeft));+ const endDate = endsAt ? formatShortDate(endsAt, "en") : undefined;+return (<EmailShell- preview={title(workspaceName, daysLeft)}- title={title(workspaceName, daysLeft)}- subtitle={subtitle(daysLeft)}+ title={title(daysLeft)}+ preview={preview(workspaceName, daysLeft)}+ lang="en">- <Section>- <Link style={styles.button} href={billingUrl}>- Choose a plan- </Link>- <Text style={styles.paragraph}>- Kaneo is also free forever if you host it yourself, with every feature- included. You can export your data at any time and move it to your own- server.- </Text>- <Section style={styles.divider} />- <Text style={styles.footer}>- You are receiving this because you own this workspace on Kaneo Cloud.- </Text>- </Section>+ <EmailIntro title={title(daysLeft)} subtitle={subtitle(daysLeft)} />+ <Frame+ title="Kaneo Cloud trial"+ description={+ endDate+ ? `${workspaceName} workspace, ends ${endDate}`+ : `${workspaceName} workspace`+ }+ >+ <Progress+ label={`${used} of ${trialDays} days used`}+ value={remaining(daysLeft)}+ percent={(used / trialDays) * 100}+ />+ </Frame>+ <Spacer size={20} />+ <EmailButton href={billingUrl} icon="credit-card-light">+ Choose a plan+ </EmailButton>+ <EmailNote title="Rather run it yourself?">+ Kaneo is free forever when you host it, with every feature included. You+ can export your data at any time and move it to your own server.+ </EmailNote>+ <EmailFooter+ title="Kaneo Cloud billing"+ reason={+ ? `Sent to ${email} because you own the ${workspaceName} workspace on Kaneo Cloud.`+ : `You are receiving this because you own this workspace on Kaneo Cloud.`+ }+ links={footerLinks("en", [{ label: "Billing", href: billingUrl }])}+ /></EmailShell>);};+TrialReminderEmail.PreviewProps = {+ workspaceName: "Acme",+ daysLeft: 3,+ billingUrl: "https://cloud.kaneo.app/dashboard/settings/workspace/billing",+ trialDays: 14,+ endsAt: "2026-10-14T00:00:00.000Z",+ email: "[email protected]",+} as TrialReminderEmailProps;+export default TrialReminderEmail;diff --git a/packages/email/src/templates/workspace-invitation.test.ts b/packages/email/src/templates/workspace-invitation.test.tsindex 8ef0878c5..ef1d2c165 100644--- a/packages/email/src/templates/workspace-invitation.test.ts+++ b/packages/email/src/templates/workspace-invitation.test.ts@@ -98,4 +98,24 @@ describe("WorkspaceInvitationEmail default copy", () => {expect(html).toBe(withEnUs);});++ it("renders the role and expiry with translated labels", async () => {+ const html = await render(+ createElement(WorkspaceInvitationEmail, {+ workspaceName: "Équipe Produit",+ inviterName: "Camille",+ inviterEmail: "[email protected]",+ invitationLink: "https://kaneo.example/invite/abc",+ to: "[email protected]",+ locale: "fr-FR",+ role: "Membre",+ expiresAt: new Date("2026-10-13T12:00:00Z"),+ copy: frFR.invitations.email,+ }),+ );++ expect(html).toContain("Détails de l’invitation");+ expect(html).toContain("Membre");+ expect(html).toContain("13 oct. 2026");+ });});diff --git a/packages/email/src/templates/workspace-invitation.tsx b/packages/email/src/templates/workspace-invitation.tsxindex 0e624094c..2e7292051 100644--- a/packages/email/src/templates/workspace-invitation.tsx+++ b/packages/email/src/templates/workspace-invitation.tsx@@ -1,6 +1,16 @@-import { Link, Section, Text } from "@react-email/components";import React from "react";-import { EmailShell, styles } from "./shell";+import { Badge } from "../components/badge";+import { DetailRows } from "../components/detail-rows";+import { EmailFooter } from "../components/email-footer";+import { EmailIntro } from "../components/email-intro";+import { EmailNote } from "../components/email-note";+import { EmailShell } from "../components/email-shell";+import { footerLinks } from "../components/footer-links";+import { type DateInput, formatDate } from "../components/format-date";+import { Frame } from "../components/frame";+import { InvitationCard } from "../components/invitation-card";+import { Spacer } from "../components/spacer";+import { resolveEmailLocale } from "./resolve-locale";void React;@@ -10,6 +20,10 @@ export type WorkspaceInvitationEmailProps = {inviterEmail: string;invitationLink: string;to: string;+ locale?: string | null;+ role?: string;+ expiresAt?: DateInput;+ instance?: string;copy?: WorkspaceInvitationEmailCopy;};@@ -22,11 +36,15 @@ export type WorkspaceInvitationEmailCopy = {sameEmail: string;ignore: string;footer: string;+ details?: {+ title: string;+ sentTo: string;+ instance: string;+ role: string;+ expires: string;+ };};-// Inlined rather than imported from i18n/en-US.json: this package builds with-// tsc, so the import would survive into dist and resolve outside the published-// files at runtime.const DEFAULT_COPY: WorkspaceInvitationEmailCopy = {subject: "{{inviterName}} invited you to join {{workspaceName}} on Kaneo",preview: "You're invited to {{workspaceName}} on Kaneo",@@ -37,6 +55,13 @@ const DEFAULT_COPY: WorkspaceInvitationEmailCopy = {sameEmail: "You can accept with the same email that received this message.",ignore: "If this wasn't expected, you can safely ignore this email.",footer: "Kaneo workspace invitation",+ details: {+ title: "Invitation details",+ sentTo: "Sent to",+ instance: "Instance",+ role: "Role",+ expires: "Expires",+ },};function interpolate(template: string, values: Record<string, string>) {@@ -51,46 +76,70 @@ const WorkspaceInvitationEmail = ({inviterEmail,invitationLink,to,+ locale,+ role,+ expiresAt,+ instance,copy = DEFAULT_COPY,}: WorkspaceInvitationEmailProps) => {const values = { workspaceName, inviterName, inviterEmail };+ const lang = locale ?? "en";+ const details = copy.details;+ const detailRows = details+ ? [+ { label: details.sentTo, value: to },+ { label: details.instance, value: instance },+ { label: details.role, value: role ? <Badge>{role}</Badge> : null },+ {+ label: details.expires,+ value: expiresAt ? formatDate(expiresAt, lang) : undefined,+ },+ ].filter((row) => Boolean(row.value))+ : [];return (<EmailShell- preview={interpolate(copy.preview, values)}title={interpolate(copy.title, values)}- subtitle={interpolate(copy.subtitle, values)}+ preview={interpolate(copy.preview, values)}+ lang={lang}>- <Section>- <Link style={styles.button} href={`${invitationLink}?email=${to}`}>- {copy.cta}- </Link>- <Text style={styles.paragraph}>{copy.sameEmail}</Text>- <Text style={styles.muted}>{copy.ignore}</Text>- <Section style={styles.divider} />- <Text style={styles.footer}>{copy.footer}</Text>- </Section>+ <EmailIntro+ title={interpolate(copy.title, values)}+ subtitle={interpolate(copy.subtitle, values)}+ />+ <InvitationCard+ workspaceName={workspaceName}+ description={copy.sameEmail}+ cta={copy.cta}+ href={`${invitationLink}?email=${encodeURIComponent(to)}`}+ />+ {details && detailRows.length > 0 ? (+ <>+ <Spacer size={20} />+ <Frame title={details.title} panelPadding="8px 20px">+ <DetailRows rows={detailRows} />+ </Frame>+ </>+ ) : null}+ <EmailNote>{copy.ignore}</EmailNote>+ <EmailFooter+ title={copy.footer}+ links={footerLinks(resolveEmailLocale(locale))}+ /></EmailShell>);};WorkspaceInvitationEmail.PreviewProps = {- workspaceName: "Acme Inc",- inviterName: "John Doe",- inviterEmail: "[email protected]",- invitationLink: "https://kaneo.app/invite/abc123",- to: "[email protected]",- copy: {- subject: "{{inviterName}} invited you to join {{workspaceName}} on Kaneo",- preview: "You're invited to {{workspaceName}} on Kaneo",- title: "Join {{workspaceName}}",- subtitle:- "{{inviterName}} ({{inviterEmail}}) invited you to collaborate in Kaneo.",- cta: "Accept invitation",- sameEmail: "You can accept with the same email that received this message.",- ignore: "If this wasn't expected, you can safely ignore this email.",- footer: "Kaneo workspace invitation",- },+ workspaceName: "Acme",+ inviterName: "Sarah Chen",+ inviterEmail: "[email protected]",+ invitationLink: "https://cloud.kaneo.app/invitation/accept/abc123",+ to: "[email protected]",+ locale: "en-US",+ role: "Member",+ expiresAt: "2026-10-13T14:12:00.000Z",+ instance: "cloud.kaneo.app",} as WorkspaceInvitationEmailProps;export default WorkspaceInvitationEmail;diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 3b39b8498..7c6dd0a02 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -105,7 +105,7 @@ importers:version: 7.0.2vite-plus:specifier: 'catalog:'- version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected]([email protected]))([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])+ version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])apps/api:dependencies:@@ -223,7 +223,7 @@ importers:version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])vitest:specifier: 'catalog:'- version: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ version: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))apps/site:dependencies:@@ -633,7 +633,7 @@ importers:version: '@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'vite-plus:specifier: 'catalog:'- version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected]([email protected]))([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])+ version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])packages/cli:devDependencies:@@ -695,6 +695,9 @@ importers:'@react-email/render':specifier: ^2.1.0+ '@react-email/ui':+ specifier: 6.11.0+ version: 6.11.0(@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])'@types/react':specifier: ^19.3.0version: 19.3.0@@ -709,7 +712,7 @@ importers:version: 7.0.2vite-plus:specifier: 'catalog:'- version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])+ version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected]([email protected]))([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])packages/libs:devDependencies:@@ -739,7 +742,7 @@ importers:version: '@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'vite-plus:specifier: 'catalog:'- version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected]([email protected]))([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])+ version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])packages/mcp:dependencies:@@ -792,7 +795,7 @@ importers:version: '@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'vite-plus:specifier: 'catalog:'- version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected]([email protected]))([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])+ version: 1.0.0(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])packages/planka-import:dependencies:@@ -2008,21 +2011,43 @@ packages:resolution: {integrity: sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==}engines: {node: '>=18'}+ '@next/[email protected]':+ resolution: {integrity: sha512-U2eYQRwXj+dsqxV79zFqExDdatnNY/ZWc2nsJU1p/OgT7fd3dXwlF6OjYaFQCfMoeTA19PWq+wVmYgimVA+V+g==}+'@next/[email protected]':resolution: {integrity: sha512-Al9zqHVV7TJv0eFuOU4U7Lvv74PTih4Ch63sk2xCIpSTkE3udFnaOcnzP2lQVymiL7yS9Cj2iClUXlR3EQ5sEw==}+ '@next/[email protected]':+ resolution: {integrity: sha512-8Hiv32QJPwdV6KYJ8meR9SBA061tQqnIKTJDocvOXlEQqib0xMFpzArosuffFUUc0sslbh7QQ8a3Yey1QV8EIw==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [darwin]+'@next/[email protected]':resolution: {integrity: sha512-2JPRMh2nmQG5CiL7cXGL9AGwnPWJQ//cTtAUCT+w511QHk79SYz3LGv/pc5X643B/WEO0rvu3Yww0hqwt3kgeA==}engines: {node: '>= 10'}cpu: [arm64]os: [darwin]+ '@next/[email protected]':+ resolution: {integrity: sha512-A1lgKgwVchRYmSe467zdwhxT9040dd8lH+o65sL5Jet8fjB4kegw/rDyPIpYVRb6jAqwXFOJpjIXJLxQKLiE3A==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [darwin]+'@next/[email protected]':resolution: {integrity: sha512-GZtCCOBKJ4leVIT/Th0llWKhD1ca92lzbQiS5R5ON9QkoiFnilFsebDae1JU2a3HWoKMEmEZWGs1AGLavVM72Q==}engines: {node: '>= 10'}cpu: [x64]os: [darwin]+ '@next/[email protected]':+ resolution: {integrity: sha512-bf0FIssMFueU2dm7vQEWWxk0c8UjKTdW0yzuh0sQsD8pf1+KCLDdaqhYZNMYGmXwEOiHAUzgBKudovIlcvvBjg==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]+'@next/[email protected]':resolution: {integrity: sha512-O659ygeQYqneJ1fBKMpFxIFqYkYswu8IAS1OCKK/4f3ZgJJm1dRz4fVJZRi/kLLWjnBKnebOePA4WNv+sV1pVA==}engines: {node: '>= 10'}@@ -2030,6 +2055,13 @@ packages:os: [linux]libc: [glibc]+ '@next/[email protected]':+ resolution: {integrity: sha512-W7viwCk9JY/cAkdz/A273rd5bb3RgT/IHwR7Upv90tunjBWNtAAhGhoecHh+teRNRSinuAFmE+l7fwZ4YKkrXg==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [linux]+ libc: [musl]+'@next/[email protected]':resolution: {integrity: sha512-dSjKSyWpzxoO1d3DIZZcP4XJcNaKeLmxQMFOiYl5vuBRMmweIqnAhty8tAmRsvTss779cK1FtYnDMj40e4TQlg==}engines: {node: '>= 10'}@@ -2037,6 +2069,13 @@ packages:os: [linux]libc: [musl]+ '@next/[email protected]':+ resolution: {integrity: sha512-0W46zw1N3ODpI6n0GeivHvvob1pooozgZVqy65k0mh4/7vr+FbY9+WpHzNVXjHipJf/A3FDheBG19H1s5A25rA==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [linux]+ libc: [glibc]+'@next/[email protected]':resolution: {integrity: sha512-lbqOuz3RPRcv+o9msNsJw5x4+Y1ZwPTs6vmL6DCf7i0fZfvng/F59wyeDwqHIvV0mK//RBy/jJkZ+nCKsSMXjQ==}engines: {node: '>= 10'}@@ -2044,6 +2083,13 @@ packages:os: [linux]libc: [glibc]+ '@next/[email protected]':+ resolution: {integrity: sha512-H4mBso8ZTMBPtdT0PN0pBx2ayTvQuTuvS6qT13d77yVFJXAPCxkyIhLTmdMaGTJs0krQYI/qpzdHijCeihXhbg==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [linux]+ libc: [musl]+'@next/[email protected]':resolution: {integrity: sha512-+316WswI8ScVgZeUd+1KGaXkHhaYQzCjvH/05TZSpJ8zBizb1a4G7DtO7F12jcBIqMOtsz9ji1t48fmKtzqsGA==}engines: {node: '>= 10'}@@ -2051,12 +2097,24 @@ packages:os: [linux]libc: [musl]+ '@next/[email protected]':+ resolution: {integrity: sha512-cTMUJpcEGmeywofCUfhR+rSsoE33+rVPnPEYNTNdLNlsOeEg/vktOsKUSTb28vUGqD2jkm4Zaskcwn7OCI6FQg==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [win32]+'@next/[email protected]':resolution: {integrity: sha512-ji0gd4kMYUxO+1fJBIbiBVRCjzG/lloiyCccnlebvb1ZJ5qXCPZqYg4Jl1DrrixnWNMKylzgpmMWx0yNDYXlzw==}engines: {node: '>= 10'}cpu: [arm64]os: [win32]+ '@next/[email protected]':+ resolution: {integrity: sha512-2VR4cTBzHXaBjnGsuH6GyJjENzQOmHeAh11uY1iUhjm3j5dEUrVJuUj+VL78jaGi/Dik8xS76zEj18BsFhlVZQ==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [win32]+'@next/[email protected]':resolution: {integrity: sha512-WcTlaKt/TWkh5kUjdJcUmB1XgZ+1c6fz4Y9fDHL73YNSdGaUWjceeWrrlwF0nv19iABYWC4iAq1oX1w4Bn0vfg==}engines: {node: '>= 10'}@@ -3668,6 +3726,9 @@ packages:peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc+ '@react-email/[email protected]':+ resolution: {integrity: sha512-6bS3hnXHv4Uq5pLEdcg3c1ntr/0yrWVuTMdi9OJGZecK2LCHF5a+J4eNQ4PuMgpP2FJDYhXIuF22aRe3L1nW3Q==}+'@redis/[email protected]':resolution: {integrity: sha512-NQ5poYpZr0jv6zazN1cy6JY5kIipKFZ3R9GTL4kOUTX3a9YAfY29U8bsE4lWhVQEM+G4V0BXVC57mubIdDijeA==}engines: {node: '>= 20.0.0'}@@ -7865,6 +7926,27 @@ packages:resolution: {integrity: sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==}+ resolution: {integrity: sha512-tuRTx1nQ/yVw83cwJBo9F+njGUgMn3UHQycreWHB8XsStvvAh1AthbI8/4IpKnFaF58F+iSiHejYOlMQ/eq83g==}+ engines: {node: '>=20.9.0'}+ hasBin: true+ peerDependencies:+ '@opentelemetry/api': ^1.1.0+ '@playwright/test': ^1.51.1+ babel-plugin-react-compiler: '*'+ react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0+ react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0+ sass: ^1.3.0+ peerDependenciesMeta:+ '@opentelemetry/api':+ optional: true+ '@playwright/test':+ optional: true+ babel-plugin-react-compiler:+ optional: true+ sass:+ optional: true+resolution: {integrity: sha512-U7QEZaTini6wKrb8A8hqLLqYQyCetegKjCpJOyxk642vWoMoU1x5PyZCJFvgYgiptA8xc5j/9xYlZFO7w9Sjmw==}engines: {node: '>=20.9.0'}@@ -11027,29 +11109,55 @@ snapshots:strict-event-emitter: 0.5.1optional: true+ '@next/[email protected]': {}+'@next/[email protected]': {}+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true@@ -12497,6 +12605,22 @@ snapshots:dependencies:react: 19.3.0+ '@react-email/[email protected](@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ esbuild: 0.28.1+ jiti: 2.6.1+ next: 16.3.3(@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])+ transitivePeerDependencies:+ - '@babel/core'+ - '@opentelemetry/api'+ - '@playwright/test'+ - '@types/node'+ - babel-plugin-macros+ - babel-plugin-react-compiler+ - react+ - react-dom+ - sass+dependencies:'@redis/client': 6.3.0(@opentelemetry/[email protected])@@ -13341,7 +13465,7 @@ snapshots:picocolors: 1.1.1redent: 3.0.0optionalDependencies:- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))'@testing-library/[email protected](@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:@@ -13912,7 +14036,7 @@ snapshots:'@testing-library/dom': 10.4.1'@testing-library/user-event': 14.6.7(@testing-library/[email protected])'@vitest/browser': 5.0.1(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected])- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))transitivePeerDependencies:- bufferutil- msw@@ -13929,7 +14053,7 @@ snapshots:pngjs: 7.0.0sirv: 3.0.2tinyrainbow: 3.1.1- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))ws: 8.21.3transitivePeerDependencies:- bufferutil@@ -13947,7 +14071,7 @@ snapshots:obug: 2.2.1std-env: 4.2.0tinyrainbow: 3.1.1- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))'@vitest/[email protected]': {}@@ -14008,7 +14132,7 @@ snapshots:pathe: 2.0.3sirv: 3.0.2tinyrainbow: 3.1.1- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))'@vitest/[email protected]':dependencies:@@ -14327,7 +14451,7 @@ snapshots:react: 19.3.0react-dom: 19.3.0([email protected])solid-js: 1.9.15- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))transitivePeerDependencies:- '@cloudflare/workers-types'- '@opentelemetry/api'@@ -14363,7 +14487,7 @@ snapshots:react: 19.3.0react-dom: 19.3.0([email protected])solid-js: 1.9.15- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))transitivePeerDependencies:- '@cloudflare/workers-types'- '@opentelemetry/api'@@ -16541,6 +16665,33 @@ snapshots:+ [email protected](@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected]):+ dependencies:+ '@next/env': 16.3.3+ '@swc/helpers': 0.5.23+ baseline-browser-mapping: 2.11.25+ caniuse-lite: 1.0.30001812+ postcss: 8.5.28+ react: 19.3.0+ react-dom: 19.3.0([email protected])+ styled-jsx: 5.1.6(@babel/[email protected])([email protected])+ optionalDependencies:+ '@next/swc-darwin-arm64': 16.3.3+ '@next/swc-darwin-x64': 16.3.3+ '@next/swc-linux-arm64-gnu': 16.3.3+ '@next/swc-linux-arm64-musl': 16.3.3+ '@next/swc-linux-x64-gnu': 16.3.3+ '@next/swc-linux-x64-musl': 16.3.3+ '@next/swc-win32-arm64-msvc': 16.3.3+ '@next/swc-win32-x64-msvc': 16.3.3+ '@opentelemetry/api': 1.9.1+ babel-plugin-react-compiler: 1.0.0+ sharp: 0.35.4(@types/[email protected])+ transitivePeerDependencies:+ - '@babel/core'+ - '@types/node'+ - babel-plugin-macros+[email protected](@babel/[email protected])(@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected]):dependencies:'@next/env': 16.3.8@@ -18465,7 +18616,7 @@ snapshots:oxlint: 1.85.0([email protected])([email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected]([email protected]))([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected]))oxlint-tsgolint: 7.0.2003vite: '@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))optionalDependencies:'@voidzero-dev/vite-plus-darwin-arm64': 1.0.0'@voidzero-dev/vite-plus-darwin-x64': 1.0.0@@ -18520,7 +18671,7 @@ snapshots:oxlint: 1.85.0([email protected])([email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected]))oxlint-tsgolint: 7.0.2003vite: '@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'- vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))optionalDependencies:'@voidzero-dev/vite-plus-darwin-arm64': 1.0.0'@voidzero-dev/vite-plus-darwin-x64': 1.0.0@@ -18575,7 +18726,7 @@ snapshots:tsx: 4.23.15yaml: 2.9.0- [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected]([email protected]))(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected])):+ [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected])):dependencies:'@types/chai': 5.2.3'@vitest/mocker': 5.0.3(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))@@ -18600,7 +18751,7 @@ snapshots:transitivePeerDependencies:- msw- [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected](@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected]))(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])):+ [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])):dependencies:'@types/chai': 5.2.3'@vitest/mocker': 5.0.3([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))@@ -18619,7 +18770,6 @@ snapshots:optionalDependencies:'@opentelemetry/api': 1.9.1'@types/node': 26.6.3- '@vitest/browser-preview': 5.0.1(@voidzero-dev/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected](@types/[email protected])([email protected]))([email protected])'@vitest/coverage-v8': 5.0.3([email protected])jsdom: 30.1.1(@noble/[email protected])transitivePeerDependencies:diff --git a/tests/api-integration/auth-registration-policy.test.ts b/tests/api-integration/auth-registration-policy.test.tsindex 94c5c823c..a398008b9 100644--- a/tests/api-integration/auth-registration-policy.test.ts+++ b/tests/api-integration/auth-registration-policy.test.ts@@ -21,6 +21,9 @@ const headers = {"content-type": "application/json",Origin: "http://localhost:5173",};++const iphoneSafari =+ "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1";async function post(path: string,body: unknown,@@ -226,14 +229,21 @@ describe("auth registration and bootstrap boundaries", () => {for (const address of ["[email protected]", member.user.email]) {expect((- await post("/email-otp/send-verification-otp", {- email: address,- type: "sign-in",- })+ await post(+ "/email-otp/send-verification-otp",+ { email: address, type: "sign-in" },+ { "user-agent": iphoneSafari },+ )).status,).toBe(200);expect(- (await post("/sign-in/magic-link", { email: address })).status,+ (+ await post(+ "/sign-in/magic-link",+ { email: address },+ { "user-agent": iphoneSafari },+ )+ ).status,).toBe(200);}expect(send).toHaveBeenCalledTimes(1);@@ -242,6 +252,15 @@ describe("auth registration and bootstrap boundaries", () => {expect(sendMagicLink.mock.lastCall?.[0]).toBe(member.user.email);const data = send.mock.lastCall?.[2] as { otp: string } | undefined;expect(data?.otp).toBeTruthy();+ expect(send.mock.lastCall?.[1]).toBe(+ `${data?.otp} is your Kaneo sign-in code`,+ );+ const requestContext = expect.objectContaining({+ device: { browser: "Safari", os: "iPhone" },+ requestedAt: expect.any(Date),+ });+ expect(send.mock.lastCall?.[2]).toEqual(requestContext);+ expect(sendMagicLink.mock.lastCall?.[2]).toEqual(requestContext);const response = await post("/sign-in/email-otp", {email: member.user.email,otp: data?.otp,diff --git a/tests/api-integration/invitation-email-failure.test.ts b/tests/api-integration/invitation-email-failure.test.tsindex 9f82ec22b..e399c6eb2 100644--- a/tests/api-integration/invitation-email-failure.test.ts+++ b/tests/api-integration/invitation-email-failure.test.ts@@ -57,6 +57,9 @@ describe("invitation email failure reporting", () => {code: "INVITATION_EMAIL_FAILED",});expect(await db.select().from(schema.invitationTable)).toHaveLength(1);+ expect(send.mock.lastCall?.[2]).toEqual(+ expect.objectContaining({ role: "Member", expiresAt: expect.any(Date) }),+ );expect((await post(diff --git a/tests/api-integration/notification-delivery-events.test.ts b/tests/api-integration/notification-delivery-events.test.tsindex 4e47f6a96..9886eacfe 100644--- a/tests/api-integration/notification-delivery-events.test.ts+++ b/tests/api-integration/notification-delivery-events.test.ts@@ -120,6 +120,18 @@ describe("status, comment and mention delivery", () => {}await vi.waitFor(() => expect(send).toHaveBeenCalledTimes(1));expect(send.mock.calls[0][0]).toBe(recipient.user.email);+ expect(send.mock.calls[0][2]).toEqual(+ expect.objectContaining({+ breadcrumb: expect.stringContaining(" / "),+ settingsUrl: expect.stringContaining(+ "/dashboard/settings/account/notifications",+ ),+ task: expect.objectContaining({+ title: task.title,+ ticket: expect.stringMatching(/-\d+$/),+ }),+ }),+ );await vi.waitFor(() =>expect(sendOutboundRequest).toHaveBeenCalledTimes(1),);diff --git a/tests/api-integration/password-reset.test.ts b/tests/api-integration/password-reset.test.tsindex 095c06186..3df7dbe40 100644--- a/tests/api-integration/password-reset.test.ts+++ b/tests/api-integration/password-reset.test.ts@@ -25,7 +25,12 @@ const redirectTo = `${origin}/auth/reset-password`;function post(path: string, body: unknown) {return createApp().app.request(`/api/auth${path}`, {method: "POST",- headers: { "content-type": "application/json", Origin: origin },+ headers: {+ "content-type": "application/json",+ Origin: origin,+ "user-agent":+ "Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0",+ },body: JSON.stringify(body),});}@@ -60,7 +65,12 @@ async function requestReset() {);const props = vi.mocked(email.sendPasswordResetEmail).mock.calls.at(-1)?.[2];expect(props).toEqual(- expect.objectContaining({ locale: "de-DE", userName: "Reset user" }),+ expect.objectContaining({+ locale: "de-DE",+ userName: "Reset user",+ device: { browser: "Firefox", os: "Linux" },+ requestedAt: expect.any(Date),+ }),);const link = new URL((props as { resetLink: string }).resetLink);expect(link.origin).toBe("http://localhost:1337");