@inkeep/agents-email 0.58.20 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/email-footer.d.ts
4
4
  interface EmailFooterProps {
@@ -6,6 +6,6 @@ interface EmailFooterProps {
6
6
  }
7
7
  declare function EmailFooter({
8
8
  securityText
9
- }: EmailFooterProps): react_jsx_runtime3.JSX.Element;
9
+ }: EmailFooterProps): react_jsx_runtime4.JSX.Element;
10
10
  //#endregion
11
11
  export { EmailFooter };
@@ -1,6 +1,13 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/email-header.d.ts
4
- declare function EmailHeader(): react_jsx_runtime4.JSX.Element;
4
+ interface EmailHeaderProps {
5
+ title: string;
6
+ description?: string;
7
+ }
8
+ declare function EmailHeader({
9
+ title,
10
+ description
11
+ }: EmailHeaderProps): react_jsx_runtime1.JSX.Element;
5
12
  //#endregion
6
13
  export { EmailHeader };
@@ -1,16 +1,35 @@
1
1
  import { LOGO_ALT, LOGO_HEIGHT, LOGO_URL } from "../theme.js";
2
- import { Img, Section } from "@react-email/components";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { Column, Img, Row, Section, Text } from "@react-email/components";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/email-header.tsx
6
- function EmailHeader() {
6
+ function EmailHeader({ title, description }) {
7
7
  return /* @__PURE__ */ jsx(Section, {
8
8
  className: "py-[24px]",
9
- children: /* @__PURE__ */ jsx(Img, {
10
- src: LOGO_URL,
11
- alt: LOGO_ALT,
12
- height: LOGO_HEIGHT
13
- })
9
+ children: /* @__PURE__ */ jsxs(Row, { children: [/* @__PURE__ */ jsx(Column, {
10
+ style: {
11
+ width: 48,
12
+ verticalAlign: "middle"
13
+ },
14
+ children: /* @__PURE__ */ jsx(Img, {
15
+ src: LOGO_URL,
16
+ alt: LOGO_ALT,
17
+ height: LOGO_HEIGHT,
18
+ width: LOGO_HEIGHT
19
+ })
20
+ }), /* @__PURE__ */ jsxs(Column, {
21
+ style: {
22
+ verticalAlign: "middle",
23
+ paddingLeft: 16
24
+ },
25
+ children: [/* @__PURE__ */ jsx(Text, {
26
+ className: "text-email-text text-[20px] leading-[24px] font-semibold m-0",
27
+ children: title
28
+ }), description && /* @__PURE__ */ jsx(Text, {
29
+ className: "text-email-text-secondary text-[14px] leading-[20px] m-0 mt-[4px]",
30
+ children: description
31
+ })]
32
+ })] })
14
33
  });
15
34
  }
16
35
 
@@ -1,16 +1,20 @@
1
1
  import { ReactNode } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/email-layout.d.ts
5
5
  interface EmailLayoutProps {
6
6
  previewText: string;
7
7
  securityText: string;
8
+ title: string;
9
+ description?: string;
8
10
  children: ReactNode;
9
11
  }
10
12
  declare function EmailLayout({
11
13
  previewText,
12
14
  securityText,
15
+ title,
16
+ description,
13
17
  children
14
- }: EmailLayoutProps): react_jsx_runtime0.JSX.Element;
18
+ }: EmailLayoutProps): react_jsx_runtime3.JSX.Element;
15
19
  //#endregion
16
20
  export { EmailLayout };
@@ -5,7 +5,7 @@ import { Body, Container, Head, Html, Preview, Tailwind } from "@react-email/com
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/email-layout.tsx
8
- function EmailLayout({ previewText, securityText, children }) {
8
+ function EmailLayout({ previewText, securityText, title, description, children }) {
9
9
  return /* @__PURE__ */ jsxs(Html, {
10
10
  lang: "en",
11
11
  children: [/* @__PURE__ */ jsx(Head, {}), /* @__PURE__ */ jsx(Tailwind, {
@@ -16,7 +16,10 @@ function EmailLayout({ previewText, securityText, children }) {
16
16
  children: [/* @__PURE__ */ jsx(Preview, { children: previewText }), /* @__PURE__ */ jsxs(Container, {
17
17
  className: "bg-email-card rounded-[8px] mx-auto my-[40px] p-[32px] max-w-[600px]",
18
18
  children: [
19
- /* @__PURE__ */ jsx(EmailHeader, {}),
19
+ /* @__PURE__ */ jsx(EmailHeader, {
20
+ title,
21
+ description
22
+ }),
20
23
  children,
21
24
  /* @__PURE__ */ jsx(EmailFooter, { securityText })
22
25
  ]
@@ -1,5 +1,5 @@
1
1
  import { InvitationEmailData } from "../types.js";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/templates/invitation.d.ts
5
5
  interface InvitationEmailProps {
@@ -7,6 +7,6 @@ interface InvitationEmailProps {
7
7
  }
8
8
  declare function InvitationEmail({
9
9
  data
10
- }: InvitationEmailProps): react_jsx_runtime1.JSX.Element;
10
+ }: InvitationEmailProps): react_jsx_runtime0.JSX.Element;
11
11
  //#endregion
12
12
  export { InvitationEmail };
@@ -4,40 +4,31 @@ import { Section, Text } from "@react-email/components";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/templates/invitation.tsx
7
+ function isSSOMethod(authMethod) {
8
+ return !!authMethod && authMethod !== "email-password" && authMethod !== "google";
9
+ }
7
10
  function getCtaText(authMethod) {
8
- switch (authMethod) {
9
- case "google": return "Sign in with Google";
10
- case "sso": return "Sign in with SSO";
11
- default: return "Accept Invitation";
12
- }
11
+ if (authMethod === "google") return "Sign in with Google";
12
+ if (isSSOMethod(authMethod)) return "Sign in with SSO";
13
+ return "Accept Invitation";
13
14
  }
14
15
  function getInstructions(authMethod) {
15
- switch (authMethod) {
16
- case "google": return "Sign in with your Google account to get started.";
17
- case "sso": return "Sign in with your organization's SSO to get started.";
18
- default: return "Click the button below to accept the invitation and set up your account.";
19
- }
16
+ if (authMethod === "google") return "Sign in with your Google account to get started.";
17
+ if (isSSOMethod(authMethod)) return "Sign in with your organization's SSO to get started.";
18
+ return "Click the button below to accept the invitation and set up your account.";
20
19
  }
21
20
  function InvitationEmail({ data }) {
22
21
  const { inviterName, organizationName, role, invitationUrl, authMethod, expiresInDays = 7 } = data;
23
22
  return /* @__PURE__ */ jsxs(EmailLayout, {
24
23
  previewText: `Accept your invitation to the ${organizationName} organization on Inkeep as ${role}.`,
25
24
  securityText: "If you didn't expect this invitation, you can safely ignore this email.",
25
+ title: `Join ${organizationName}`,
26
+ description: `${inviterName} invited you as ${role}.`,
26
27
  children: [
27
- /* @__PURE__ */ jsxs(Section, { children: [/* @__PURE__ */ jsxs(Text, {
28
- className: "text-email-text text-[16px] leading-[24px] mt-0",
29
- children: [
30
- inviterName,
31
- " invited you to the ",
32
- /* @__PURE__ */ jsx("strong", { children: organizationName }),
33
- " organization on Inkeep as ",
34
- /* @__PURE__ */ jsx("strong", { children: role }),
35
- "."
36
- ]
37
- }), /* @__PURE__ */ jsx(Text, {
38
- className: "text-email-text-secondary text-[14px] leading-[20px]",
28
+ /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsx(Text, {
29
+ className: "text-email-text-secondary text-[14px] leading-[20px] mt-0",
39
30
  children: getInstructions(authMethod)
40
- })] }),
31
+ }) }),
41
32
  /* @__PURE__ */ jsx(Section, {
42
33
  className: "text-center my-[24px]",
43
34
  children: /* @__PURE__ */ jsx(EmailButton, {
@@ -9,30 +9,22 @@ function PasswordResetEmail({ data }) {
9
9
  return /* @__PURE__ */ jsxs(EmailLayout, {
10
10
  previewText: `This link expires in ${expiresInMinutes} minutes.`,
11
11
  securityText: "If you didn't request this, you can safely ignore this email.",
12
- children: [
13
- /* @__PURE__ */ jsxs(Section, { children: [/* @__PURE__ */ jsx(Text, {
14
- className: "text-email-text text-[16px] leading-[24px] mt-0",
15
- children: "Reset your Inkeep password"
16
- }), /* @__PURE__ */ jsx(Text, {
17
- className: "text-email-text-secondary text-[14px] leading-[20px]",
18
- children: "We received a request to reset the password for your account."
19
- })] }),
20
- /* @__PURE__ */ jsx(Section, {
21
- className: "text-center my-[24px]",
22
- children: /* @__PURE__ */ jsx(EmailButton, {
23
- href: resetUrl,
24
- children: "Reset Password"
25
- })
26
- }),
27
- /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsxs(Text, {
28
- className: "text-email-text-muted text-[12px] leading-[16px]",
29
- children: [
30
- "This link expires in ",
31
- expiresInMinutes,
32
- " minutes."
33
- ]
34
- }) })
35
- ]
12
+ title: "Reset your password",
13
+ description: "We received a request to reset the password for your account.",
14
+ children: [/* @__PURE__ */ jsx(Section, {
15
+ className: "text-center my-[24px]",
16
+ children: /* @__PURE__ */ jsx(EmailButton, {
17
+ href: resetUrl,
18
+ children: "Reset Password"
19
+ })
20
+ }), /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsxs(Text, {
21
+ className: "text-email-text-muted text-[12px] leading-[16px]",
22
+ children: [
23
+ "This link expires in ",
24
+ expiresInMinutes,
25
+ " minutes."
26
+ ]
27
+ }) })]
36
28
  });
37
29
  }
38
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-email",
3
- "version": "0.58.20",
3
+ "version": "0.59.0",
4
4
  "description": "Email service for Inkeep Agents — transactional emails via Nodemailer/SMTP",
5
5
  "private": false,
6
6
  "type": "module",